神刀安全网

React Sync Demo

React Sync Demo

React Sync Demo

This is a modified version of the React comment box example from the React tutorial . The example app has been modified to demonstrate syncing updates and offline activity across devices.

React Sync Demo

To use

Start the server with:

npm install node server.js

And visit http://localhost:3000/ . Try opening multiple tabs!

You can change the port number by setting the $PORT environment variable before invoking the script, e.g.,

PORT=3001 node server.js

Development

Primus is set to create a new public/scripts/primus.js file when the server starts. If you’re using nodemon to restart on file changes:

nodemon --ignore public --ignore comments.json

Webpack config in webpack.config.js runs DefinePlugin to set NODE_ENV to production, and UglifyJS to minify files. Comment out the plugins, then run webpack:

webpack ---watch

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » React Sync Demo

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址