如何从对象的函数中获取返回值

我想从对象中的函数获取返回值

它可以在对象中调用函数,但我无法获得返回值

我应该怎么做

const depthCheck = state => {
  let index = state.index === undefined ? null : state.index;
  if (index !== null) {
    depthCheck(state.routes[index]);
  } else {
    console.log(state);
    return state;
  }
};

const RootStack = createStackNavigator(
  {
    TabNavigator,},{
    defaultNavigationOptions: ({ navigation }) => (
      //call function but i cant get return value from console
      console.log(depthCheck(navigation.state))
    ),);
city0113 回答:如何从对象的函数中获取返回值

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3146058.html

大家都在问