Cerebral React Native iOS Demo
The awesome Cerebral by Christian Alfoni running on React Native.
Try it out
1. Install the debugger
- Install the Chrome Cerebral Debugger
2. Setup the demo
- Clone this repo
- Run
npm install
3. Run the demo
- Run
open CerebralReactNativeIOSDemo.xcodeproj
- Run
npm start
- Click
Run
in Xcode
4. Hook into the debugger
- In the iOS Simulator:
- Press
Command-Option-z
- Click
Debug in Chrome
- In Chrome, press
Command-Option-j
(to open Developer Tools) - Navigate to the "Cerebral" tab to view your state!
- In Chrome, press
More Info
Right now, this is working due to a series of hacks that I put together. You can find them in my forks of cerebral and cerebral-react-immutable-store. The hacks aren't too bad, so hopefully we'll see support for React Native officially very soon.
If you have any trouble getting the demo running, please create an issue or find me in the #reactnative channel on freenode or Reactiflux.
The demo itself
The <TextInput>
fields are a little wonky since the JS bridge seems a little slow for it to be saving all state constantly through Cerebral. It's probably not the best example performance-wise, but it at least demonstrates what Cerebral can do with state, and it serves the main purpose of showing that it can be run on top of React Native.
What's Cerebral?!
If you haven't checked out Cerebral, please do! Check out the wonderful set of videos that Christian has recorded here and give it a try!