COMMAND FOR BUNDLE :
To genrate debug APK in android:
1.Go to project folder in terminal
2.Run this command :(if you have index.js in project root then run )* prefered
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
or (if you have index.android.js in project root then run )
react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug
3.Create debug apk:
(i) cd android/
(ii) ./gradlew assembleDebug
REACT NATIVE APP :
https://github.com/ReactNativeNews/React-Native-Apps
OBJECT KEYS :
The `Object.keys()` method returns an array of a given object's own property `names`, in the same order as we get with a normal loop.
const object1 = { a: 'somestring', b: 42, c: false };
console.log(Object.keys(object1)); // expected output: Array ["a", "b", "c"]
The `Map` object holds key-value pairs and remembers the original insertion order of the keys. Any value (both objects and primitive values) may be used as either a key or a value.
STATE AND PROPS :
There are two types of passing data,
To genrate debug APK in android:
1.Go to project folder in terminal
2.Run this command :(if you have index.js in project root then run )* prefered
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
or (if you have index.android.js in project root then run )
react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug
3.Create debug apk:
(i) cd android/
(ii) ./gradlew assembleDebug
REACT NATIVE APP :
https://github.com/ReactNativeNews/React-Native-Apps
OBJECT KEYS :
The `Object.keys()` method returns an array of a given object's own property `names`, in the same order as we get with a normal loop.
const object1 = { a: 'somestring', b: 42, c: false };
console.log(Object.keys(object1)); // expected output: Array ["a", "b", "c"]
The `Map` object holds key-value pairs and remembers the original insertion order of the keys. Any value (both objects and primitive values) may be used as either a key or a value.
STATE AND PROPS :
There are two types of passing data,
- State : Used if your component is in the same class you can simply use state to pass data between components
- Props : Used if you want to pass data between different class (child <-> parent).
Comments
Post a Comment