The awesome Cerebral by Christian Alfoni running on React Native.
- Install the Chrome Cerebral Debugger
- Clone this repo
- Run
npm install
- Run
open CerebralReactNativeIOSDemo.xcodeproj
- Run
npm start
- Click
Run
in Xcode
- 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
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 <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.
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!