Skip to content

Commit

Permalink
docs: add note on CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed Sep 14, 2023
1 parent 14182f8 commit 10ec6a7
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,17 @@ Million.js works with React. Million.js makes creating web apps just as easy (It

**TL;DR:** Imagine [React](https://react.dev) components running at the speed of raw JavaScript.

### [**📚 Learn Million.js in <5 minutes! →**](https://million.dev/)
### [**👉 Setup Million.js in seconds! →**](https://million.dev/)

## Example Usage
## Installation

Million.js is a library that enables you to create _blocks_. A block is a special [Higher Order Components (HOCs)](https://legacy.reactjs.org/docs/higher-order-components.html) that can be used as a React component but are hyper-optimized for rendering speed.
The Million.js CLI will automatically install the package and configure your project for you.

Below is an example of a React "counter" component that's been wrapped with Million.js.

```jsx
import { useState } from 'react';
import { block } from 'million/react';

// Just wrap Counter in a block() function!
const Counter = block(function Counter({ initialCount }) {
const [count, setCount] = useState(initialCount);
const handleClick = () => {
setCount(count + 1);
};

return <button onClick={handleClick}>{count}</button>;
});

export default Counter;
```bash
npx million@latest
```

[**Try the quickstart**](https://million.dev/docs/quickstart)
[**View the installation guide**](https://million.dev/docs/install)

## Codebase

Expand Down

2 comments on commit 10ec6a7

@vercel
Copy link

@vercel vercel bot commented on 10ec6a7 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sink – ./packages/kitchen-sink

sink-git-main-millionjs.vercel.app
sink-millionjs.vercel.app
million-kitchen-sink-atit.vercel.app
sink.million.dev

@vercel
Copy link

@vercel vercel bot commented on 10ec6a7 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

million-kitchen-sink – ./packages/kitchen-sink

million-kitchen-sink.vercel.app
million-kitchen-sink-millionjs.vercel.app
million-kitchen-sink-git-main-millionjs.vercel.app

Please sign in to comment.