Quoi choisir?
📚 Expo
+---------------------------+
| Expo |
| ▼ |
| React Native CLI |
| |
| +---------------------+ |
| | React / JS / TS | |
| | ▼ ▲ | |
| | React Native | |
| | Node | |
| | | |
| | +---------------+ | |
| | | | | |
| | | Android / iOS | | |
| | | | | |
| | +---------------+ | |
| +---------------------+ |
+---------------------------+
📚 Expo CLI
⬇️ Télécharger la machine virtuelle
ENV["name"] ||= "ReactNative"
PARENT_PATH = "../_utils/Vagrantfile"
load File.join(File.dirname(__FILE__), PARENT_PATH)
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = 2
end
config.vm.provision "shell", inline: <<-SHELL
sudo apt install -y nodejs npm git
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
# As standard user
sudo su etd -c '
mkdir -p ~/.npm-global/lib
npm config set prefix '~/.npm-global'
'
echo "export PATH=~/.npm-global/bin:\\$PATH" | sudo tee -a /etc/profile.d/variables.sh
echo "export REACT_NATIVE_PACKAGER_HOSTNAME=\\$(ip -f inet addr show eth1 | awk '/inet/ {print \\$2}' | grep -Po '\\d+\\.\\d+\\.\\d+.\\d+')" | sudo tee -a /etc/profile.d/variables.sh
SHELL
end
Optionnel, pour tester nativement sur un appareil Android
node -v
npm -v
npx create-expo-app test
cd test
npx expo start # --tunnel si appareil mobile pas sur le meme reseau, au Cegep etre sur TechInfo-Etudiant
# Répondre Y pour l'installation de ngrok
# Scanner le code QR avec Expo Go
git config --global user.name "John Doe"
git config --global user.email "1234567@cshawi.ca"