React Cards
React Cards is inspired by Bruce Hauman's excellent devcards project which aims to provide ClojureScript developers with a visual REPL-like experience especially suited for UI development.
React Cards tries to bring a similar experience to React developers, opening up the possibility to quickly test the look and feel as well as the behavior of a component. Furthermore enabling developers to write markdown and even run tests against the component, displaying the test results as a React component itself.
This approach has many benefits. A component with multiple possible states can be difficult to test and document. With React Cards we can display the component in many different states along with documentation and tests to ensure nothing breaks while we're working on the component.
Getting Started
npm install reactcards
Add an entry file (f.e. entry.js)
;; if modulehot modulehotaccept // of we go...;
Add reactcards to your package.json
"scripts": ... "reactcards": "reactcards -p 8080 -e ./entry.js" ...
Available options for reactcards
-p, --port <number> Port to run React Card
-e, --entry <file> Entry point for React Cards
-c, --conf <file> Custom Webpack config file
Now you can simply run
npm run reactcards
React Cards will be available at http://localhost:8080
Using React Cards in an Existing Project
Coming soon.
Creating a Static Version of Your React Cards
Coming soon.
Writing Cards
const demo = demo demo demo
Creating a Stateful Component
const demo = demo
Displaying a Component With Undo/Redo
const demo = demo
Writing Tests
// your test file... { assert} { assert} // your reactcards file const demo = demo
You can write tests in a separate folder or write them directly inside a card. The first enables us to reuse the test in a different setting. More information regarding testing very soon.
Documentation
Coming Soon.
License
Copyright © 2016 Ali Sharif, Stefan Oestreicher and contributors.
Distributed under the terms of the BSD-3-Clause license.