Skip to content

Commit

Permalink
docs: add README
Browse files Browse the repository at this point in the history
  • Loading branch information
ilharp committed Feb 7, 2024
1 parent 057704a commit bd70e57
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# react-cordis

Real React for Cordis, like Server Components.

Heavily under constructing.

## Sample

```tsx
import { useCallback, useState } from 'react'
import { render } from 'react-cordis-notifier'

export function apply(ctx: Context) {
render(ctx, <Counter />)
}

function Counter() {
const [count, setCount] = useState(0)

const increase = useCallback(() => setCount((x) => x + 1), [])
const decrease = useCallback(() => setCount((x) => x - 1), [])

return (
<>
<p>Current: {count}</p>
<button onClick={increase}>Increase</button>
<button onClick={decrease}>Decrease</button>
</>
)
}

```

## LICENSE

MIT

0 comments on commit bd70e57

Please sign in to comment.