navigation笔记

react native存在的问题
vscode怎样打断点
_onPressButton()为什么以下划线命名
setState用法 
render()用法

eslint报错 


不懂的地方:

不懂怎么调试
不懂apk入库

yarn start报错不知道怎么去解决 


1 怎样让调试栏目处于最顶部
2 怎样快速找到问题的地方
3 怎么快速打断点


类为什么前面加default import 

如何快速找到该类
线上环境 suyan-test-js/Ssuyan-cmss-1234
Ssuyan-cmss-1234

另外一个props是从哪过来的


undefined 空区别 



环境出现问题
1 查看js 和java端环境
2 删除掉缓存
3 退出编译器重新打开 两个编译器
4 androidstudio运行


EnlargeTopEmotionBar
ShinkTopEmotionBar 之间的区别 

快速打包 


开会之前提前看评审,只说问题,不需要一个个过



不太懂为什么是这个结果

function* fibs() {
    let a = 0;
    let b = 1;
   
    while (true) {
      console.log('b==')
      // yield a;
      [a, b] = [b, a + b];
      console.log('b=='+b)
    }
 
  }
  
  let [first, second, third, fourth, fifth, sixth] = fibs();

  // console.log(first)
  // console.log(second)
  // console.log(third)
  // console.log(fourth)
  // console.log(fifth)
  // console.log(sixth)


  
导航为什么这么写?
 Auth: {
            screen: AuthStack
        },
const AuthStack = createStackNavigator(
    {
        Login: {
            screen: Login
        }
    }
);

export default createSwitchNavigator(
    {
        Auth: {
            screen: AuthStack
        },
        App: AppStack
    }
)

报错
 <View style={styles.section, styles.lastSection}>

 
    let picType=this.state.condition.pic||'';
        if(picType==='1'){
            this.setState({ condition: { sortType: 1 } });
        }

不懂为什么不能这样写
 picType={this.this.state.navigationParams.itemInfo.picType}


Component  不太懂



不懂
redux全局使用

https://blog.csdn.net/weixin_40166364/article/details/78354663

https://blog.csdn.net/andy_zhang2007/article/details/80080780

https://stackoverrun.com/cn/q/12153178

---------
    <Stack.Screen name="Home" component={HomeScreen }
    function HomeScreen({ navigation }) {}

---------

react-native ScrollView 布局方向

dp概念

入门

https://juejin.im/post/5d6f27266fb9a06ad45162e1
 setTimeout(resolve, ms, 'done');方法
 map方法

function timeout(ms) {
  return new Promise((resolve, reject) => {
    setTimeout(resolve, ms, 'done');
  });
}

timeout(100).then((value) => {
  console.log(value);
});

知识点
https://juejin.im/post/5d6f27266fb9a06ad45162e1

promise
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise  已经处理

https://juejin.im/post/5b605b035188251a90189c61


text是从哪来的,怎样把值传过来
inputChange = {(text)=> this.inputChange(text)


css属性  
https://www.runoob.com/cssref/css3-pr-align-items.html


react-native 有道笔记整理 已经处理 

空指针  已经处理

const colors = {
    'light': {
        backgroundColor: '#ebebeb',
        itembgColor: '#fff',
        itemTextColor: '#333',
        borderColor: '#dddddd',
        borderColorSystemItem: '#dddddd',
        borderBottomColor: '#ddd',
        textInputBgColor: '#fff',
        contentColor: '#666',
        lableColor: '#333',
        itemTextSectionColor: '#999'
    },
    'dark': {
        backgroundColor: '#1b1b1b',
        itembgColor: '#262626',
        itemTextColor: '#999',
        borderColor: '#dddddd',
        borderColorTranslucence: 'rgba(221,221,221,0.5)',
        borderColorSystemItem: '#1b1b1b',
        textContent:'#888888',
        textContentBackGround:'#353535',
        buttonBgColor:'#c6c7c6',
        itemTextSectionColor:'#777777',
        buttonBgColorTranslucence:'rgba(198,199,198,0.5)',
    },
    darkValue:'dark',
    lightValue:'light'

}

style={[{position: 'absolute', bottom: 0},  已经处理
                          props.style]

   为什么有  props.style 

   

idea激活   已经处理


item index是从哪里过来的 ?  好像是react flatList提供 已经处理

    _keyExtractor = (item, index) => {
        console.log('----(item, index)------ ')
        console.log(item)
        console.log(index)
        return index.toString();
    }




  react-native-picker
  https://www.npmjs.com/package/react-native-picker
  https://www.jianshu.com/p/90f8d1f3d638
点击改变按钮背景色  已经处理
https://www.jianshu.com/p/e9a4843fd873


idea禁止更新提示

isNaN是什么?? 为什么要加入这个判断选项

再全面一点:(typeof(num)==="number")&&(num!==Infinity)&&!isNaN(num)


为什么_onPressButton()前面不需要加function
export default class ButtonBasics extends Component {
_onPressButton()  {
    alert('You tapped the button!')
  }


  }


图片加载不出来---没有声明权限??

vscode 参数提示
idea 参数提示

静态布局写法,静态布局显示和隐藏


不懂
redux全局使用


js 怎样调用原生代码


android 启动页面之前的状态栏颜色 
主题确定窗口的颜色,代码确定布局背景颜色 
在启动页面前面加状态栏颜色
 <style name="AppTheme.Splash" parent="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:statusBarColor" tools:ignore="NewApi">@color/color_CCCCCC</item>
    </style>

    改变窗口背景色
 <style name="AppThemeDark" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="background">@color/colorPrimaryDark</item>
        <item name="android:windowBackground">@color/colorPrimaryDark</item>
    </style>


    os version 不懂 


    
react-native 不调试的情况下 运行报错没有日志记录 

toast报错
import RootSiblings from 'react-native-root-siblings';

导航底部图标不显示

npm install 依赖莫名奇妙升级

// import App from './pages/navigators/tab/iconNavigation';

$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Loading dependency graph, done.
error Unable to resolve module `expo-font` from `node_modules/@expo/vector-icons/build/createIconSet.js`: expo-font could not be found within the project.

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules: rm -rf node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*. Run CLI with --verbose flag for more details.
Error: Unable to resolve module `expo-font` from `node_modules/@expo/vector-icons/build/createIconSet.js`: expo-font could not be found within the project.

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules: rm -rf node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
    at ModuleResolver.resolveDependency (/Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:186:15)
    at ResolutionRequest.resolveDependency (/Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/node-haste/DependencyGraph.js:282:16)
    at Object.resolve (/Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/lib/transformHelpers.js:267:42)
    at /Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/DeltaBundler/traverseDependencies.js:426:31
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/DeltaBundler/traverseDependencies.js:423:18)
    at /Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/DeltaBundler/traverseDependencies.js:275:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/steven/yuqing/demo/NavicationBar/node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)

# steven @ Steven-MacBook-Pro in ~/yuqing/demo/NavicationBar on git:master x [16:38:18] C:1
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Loading dependency graph, done.

navigation4
https://www.cnblogs.com/vipstone/p/7516115.html

React-navigation5.x(createBottomTabNavigator)底部导航栏

https://juejin.im/post/5e5744ac6fb9a07cd74f5762
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章