We are refactoring some legacy code into React and it turns out it is all reactNative.
Does anyone have any idea how we can refactor this AppRegistry.registerComponent
into React (Just regular React (like the one create-react-app installs), not React Native, not React-Web), the same goes for AppRegistry.getApplication
? We don't want ANY react-native at all, so any help would be greatly appreciated...
Could someone also point me at a decent resource so I can stop asking these asinine questions? :(
CodePudding user response:
You will not need AppRegistry
in your case. This is the entry point for your app in react native.
AppRegistry is the JS entry point to running all React Native apps. App root components should register themselves with AppRegistry.registerComponent, then the native system can load the bundle for the app and then actually run the app when it's ready by invoking AppRegistry.runApplication.
In your app, you should refactor
// react native app
import App from "./App";
...
AppRegistry.registerComponent(appName, () => App);
to
// your new app
import App from './App';
...
ReactDOM.render(<App />, document.getElementById('root'));