Skip to content

Commit 8a48ea3

Browse files
committed
Readme
1 parent 50610e0 commit 8a48ea3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# react-basic-hooks [![CircleCI](https://circleci.com/gh/spicydonuts/purescript-react-basic-hooks.svg?style=svg)](https://circleci.com/gh/spicydonuts/purescript-react-basic-hooks)
22

3-
This is an experimental implementation of React hooks on [react-basic](https://github.com/lumihq/purescript-react-basic).
3+
This is library adds React hooks to [react-basic](https://github.com/lumihq/purescript-react-basic).
44

5-
*Warning:* This API relies on recent React versions (>= 16.8.0).
5+
_Warning:_ This API relies on recent React versions (>= 16.8.0).
66
For more info on hooks, see [React's documentation](https://reactjs.org/docs/hooks-intro.html).
77

88
I recommend using PureScript's new "qualified do" syntax while using this library (it's used in the examples, the `React.do` bits).
9-
It became available in the `0.12.2` compiler release.
9+
It became available in the `0.12.2` compiler release.
1010

1111
This library provides the `React.Basic.Hooks` module, which can completely replace the `React.Basic` module.
1212
It borrows a few types from the current `React.Basic` module like `ReactComponent` and `JSX` to make it easy to use both versions in the same project.
@@ -34,7 +34,9 @@ More examples:
3434
- Components: [Parent](./examples/component/src/Container.purs) and [Child](./examples/component/src/ToggleButton.purs)
3535
- [Refs to DOM nodes](./examples/refs/src/Refs.purs) (and extracting hook logic from a component for reuse)
3636
- [A Todo App](./examples/todo-app/src/TodoApp.purs) (components, inputs, state)
37+
- [Context](./examples/context/src/Context.purs) (creating and consuming React context)
38+
- [Aff helper](./examples/aff/src/AffEx.purs) (async state management)
3739

38-
*A note on Refs:* The `Ref` type is useful for all kinds of state (anything which shouldn't trigger a render when changed), particularly references to DOM nodes as in the example.
40+
_A note on Refs:_ The `Ref` type is useful for all kinds of state (anything which shouldn't trigger a render when changed), particularly references to DOM nodes as in the example.
3941
Unfortunately, while this module remains a small extension to the existing react-basic library it won't be possible to pass a `ref` prop to the native DOM components from `React.Basic.DOM`.
4042
In the meantime, use `element (unsafeCreateDOMComponent "div") { ref: elementRef }`.

0 commit comments

Comments
 (0)