Creating a React Renderer will give you the opportunity to apply the same React knowledge that you and your team already know and enjoy from the web and native to whatever host environment you need.
Creating a renderer is a fairly straight-forward affair once you know what you’re looking for.
Many languages have this concept of a main
—the entry point to your
application. If you look at any React application code you’ve written you’ll see
that you “start” your app with a call like the following:
// web
ReactDOM.render(React.createElement(MyApp), document.getElementById('app'));
// native
AppRegistry.registerComponent('MyApp', () => MyApp);
This is where your application enters into the React domain and comes alive.
If you follow either the ReactDOM or React Native codebases from where these
methods are defined you will quickly find yourself at the React{Host}Mount.js
file. Our renderer also begins there.
With that let’s get started! Our tour continues in ./src/mount.js.
Please note this guide is a work in progress. Much of this knowledge is derived from my experience in creating React Hardware.
- @thejameskyle: for the inspiration of repo style
- @ryanflorence and @mjackson for React Router and the problem that inspired this
- @gaearon, @matthewwithanm, @vjeux, @zpao, @Yomguithereal, @axemclion, and everyone else who has helped me poke around the React codebase.