agomusa / react-run

🕺 Run React code snippets/components from your command-line without config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-run

CI

Run React code snippets/components from your command-line without config.

Usage

The entry point is a component called App, example:

// example.js
export default function App() {
  const [count, setCount] = React.useState(0);

  return (
    <div style={{ background: "purple", color: "white", padding: "10px" }}>
      <h1>Hello World</h1>
      <p>{count}</p>
      <button onClick={() => setCount(count + Math.random())}>+ random</button>
    </div>
  );
}

You could run this with:

react-run example.js

This will open your default browser with your component loaded.

Check the examples/ to see what is supported.

Installation

With cargo:

cargo install react-run

Or use a binary from releases.

License

Licensed under the MIT licence.

About

🕺 Run React code snippets/components from your command-line without config

License:MIT License


Languages

Language:Rust 76.3%Language:HTML 23.7%