index.android.js
android/settings.gradle
android/app/build.gradle
android/app/src/main/AndroidManifest.xml
android/app/src/main/java/com/<app id>/MainActivity.java
android/app/src/main/java/com/<app id>/MainApplication.java
const ViewPhotoStack = createStackNavigator({
ViewPhoto:{screen: ViewPhotoScreen}
})
createStackNavigator({
Main:{screen:MainScreen},
ViewPhoto:ViewPhotoStack
});
import React, { Component } from 'react';
import { WebView } from 'react-native-webview';
class MyInlineWeb extends Component {
render() {
return (
<WebView
originWhitelist={['*']}
source={{ html: '<h1>Hello world</h1>' }}
/>
);
}
}
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>WebView1</title>
<meta forua="true" http-equiv="Cache-Control" content="max-age=0"/>
</head>
<script type="text/javascript">
function testEcho(test){
alert(test);
}
</script>
</body>
</html>
return this.webview&&this.webview.injectJavaScript("testEcho("+JSON.stringify({...result,token:this.state.accessToken})+");")
export class App extends Component<{}> {
this.myRef = React.createRef();
constructor(props: {}) {/* ... */}
protected refreshItems() {
// Тут надо как-то вызвать метод refresh() у дочерних RandomString
if(this.myRef&&this.myRef.current&&this.myRef.current.refresh){
this.myRef.current. refresh()
}
}
render(): ReactNode {
return (
<div>
<RandomString this.myRef = React.createRef(); />
<RefreshButton onClick={this.refreshItems} />
</div>
);
}
}
const current ={lat: "59.95", lng: "30.33"}
const newObj={lat:parseFloat(current.lat),lng:parseFloat(current.lng)}
react-native unlink react-native-fs
yarn remove react-native-fs
IMPORTANT
For RN < 0.57 and/or Gradle < 3 you MUST install react-native-fs at version @2.11.17!
For RN >= 0.57 and/or Gradle >= 3 you MUST install react-native-fs at version >= @2.13.2!
For RN >= 0.61 please install react-native-fs at version >= @2.16.0!