diff --git a/examples/with-cerebral/pages/index.js b/examples/with-cerebral/pages/index.js index 1d5aa51ea188d..953fe798a9652 100644 --- a/examples/with-cerebral/pages/index.js +++ b/examples/with-cerebral/pages/index.js @@ -1,27 +1,11 @@ import React from 'react' -import { Controller, UniversalController } from 'cerebral' +import { Controller } from 'cerebral' import Devtools from 'cerebral/devtools' import { Container } from '@cerebral/react' import Page from '../components/Page' import clock from '../modules/clock' export default class Counter extends React.Component { - static getInitialProps({ req }) { - const isServer = Boolean(req) - - // On the server we prepare the state of the application. Since - // this is a synchronous state change we just use "setState", but - // you could do other async stuff here or even use "runSequence" to - // grab and set the initial state of the application using - if (isServer) { - const controller = UniversalController({ modules: { clock } }) - controller.setState('clock.lastUpdate', Date.now()) - - return { stateChanges: controller.getChanges() } - } - - return {} - } constructor(props) { super(props) // The controller will be instantiated for every page change and we only diff --git a/examples/with-cerebral/pages/other.js b/examples/with-cerebral/pages/other.js index 8d705736fe82a..3b236c4716783 100644 --- a/examples/with-cerebral/pages/other.js +++ b/examples/with-cerebral/pages/other.js @@ -1,27 +1,11 @@ import React from 'react' -import { Controller, UniversalController } from 'cerebral' +import { Controller } from 'cerebral' import Devtools from 'cerebral/devtools' import { Container } from '@cerebral/react' import Page from '../components/Page' import clock from '../modules/clock' export default class Counter extends React.Component { - static getInitialProps({ req }) { - const isServer = Boolean(req) - - // On the server we prepare the state of the application. Since - // this is a synchronous state change we just use "setState", but - // you could do other async stuff here or even use "runSequence" to - // grab and set the initial state of the application using - if (isServer) { - const controller = UniversalController({ modules: { clock } }) - controller.setState('clock.lastUpdate', Date.now()) - - return { stateChanges: controller.getChanges() } - } - - return {} - } constructor(props) { super(props) // The controller will be instantiated for every page change and we only