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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章