Skip to content

sidorares/react-up

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-up

Whip up a react component for quick standalone display.

Install and run

npm install -g react-up

then run:

reactup path/to/component.js

Options

  • --port: sets the http port (default: 8000)
  • --css: path to a css file which will be used on the page. The file is also hot-loaded if any changes are made to it.

Eg.

reactup --port=5432 --css=theme.css path/to/component.js

API Usage

var reactup = require('react-up');

reactup(filename, {
  port: 1234,
  css: './path/to.css',
  setupBrowserify: function (b) {
    // optional function where you can add custom transforms / plugins
  }
}, cb);

Live reloading

Any changes made to the source component (or other modules require'd by the component) are live-reloaded in the page.

example of live-reloading props, css and components

Setting props

You can pipe in props from stdin like this:

cat props.json | reactup path/to/component.js

And if you have something that produces a stream of ndjson you will get realtime updates whenever the props change. Eg:

npm i -g watch-json

watch-json props.json | reactup path/to/component.js

jsx and es6

Before sending to the browser we transform the component file with browserify and babelify so all of your jsx and es6 should work without a hitch (but please let me know if it doesn't!).

License

MIT

About

Whip up a react component for quick standalone display

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%