This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.state = { | |
animating: false, | |
}; | |
_startLoading = (bool) => new Promise((resolve) => { | |
this.setState({animating: bool}); | |
resolve(bool); | |
}) | |
<View |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On cherche l'index de l'élément à supprimer (ici un objet) | |
const index = array.indexOf(leg); | |
// In exécute la méthode slice si l'index n'est pas -1 | |
// Le deuxième argument est le nombre d'éléments à supprimer | |
if (index !== -1) array.splice(index, 1); | |
// Solution à faible performance car la méthode 'slice' est très couteuse | |
// Si besoins de performances alors utiliser une autre structure de données qu'un Array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render(){ | |
return( | |
{yourCondition ? <yourComponent /> : null} | |
{ this.state.btn_state ? <View> | |
{this.state.list_options} | |
</View> : null } | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PerfMonitor from 'react-native/Libraries/Performance/RCTRenderingPerf'; | |
componentDidMount() { | |
PerfMonitor.toggle(); | |
setTimeout(() => { | |
PerfMonitor.start(); | |
setTimeout(() => { | |
PerfMonitor.stop(); | |
}, 25000); | |
}, 5000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const keys = Object.keys(obj); | |
keys.map((key) => { | |
console.log(`'${key}' : ${obj[key]}`); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clean (cmd+shift+K) | |
Build core React - select React as the scheme in Xcode and build it (cmd+B) | |
Build the library that is failing (e.g. RCTText). | |
Build your app (CMD + R) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Get the fonts (.ttf) | |
2. Paste the fonts in `./src/assets/fonts/` | |
3. In `package.json` add: | |
“rnpm”: { | |
“assets”: [“./src/assets/fonts”] | |
} | |
4. Run `react-native link` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Debug SHA1 (root of project) | |
keytool -J-Duser.language=en -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android | |
Release SHA1 (/android/app/) | |
keytool -J-Duser.language=en -list -v -keystore mystore.keystore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plutôt utiliser l'outil `Profiler` de Android Studio. Les valeurs données sont différentes. | |
adb shell dumpsys meminfo <package name | pid> [-d] | |
adb shell dumpsys meminfo com.awesomeproject [-d] | |
while sleep 1; do adb shell dumpsys meminfo com.cnhrtkapp | grep 'Unknown\|Gfx dev\|TOTAL'; done |
OlderNewer