Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
UPDATE: Following instructions are now a year old. I have recently managed to upgrade react-native-maps from 0.17 to the latest version 0.21 with react-native 0.51 - if you want to follow my instruction scroll down to the end this doc! Hope that will work for you too!
This is for my personal use, things might not be correctly explained here. For the official docs please check https://github.com/airbnb/react-native-maps
Steps from scratch:
1.react-native init GoogleMapPlayground
In the default React Native app scaffolding you have to edit AppDelegate.m
to change where it loads the code if you want to test on your device. I use the following snippet to detect if it's being compiled for Debug or Production and for the Simulator or a device. For Production it uses a copy of the code included in the bundle, for Debug on the simualtor it loads from a server on localhost and for Debug on a device it loads from a server on a given IP address.
NOTE: You need to edit YOUR-IP-HERE and change it to the IP to load the code from when in Debug mode on a device. You could use a service like ngrok to make this work from anywhere.
NSURL *jsCodeLocation;
// Loading JavaScript code
#if DEBUG
// For Debug build load from development server. Start the server from the repository root:
// Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
function NPER(rate, payment, present, future, type) { | |
// Initialize type | |
var type = (typeof type === 'undefined') ? 0 : type; | |
// Initialize future value | |
var future = (typeof future === 'undefined') ? 0 : future; | |
// Evaluate rate and periods (TODO: replace with secure expression evaluator) |