react-life-game
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "react-life-game", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist", |
@@ -5,3 +5,3 @@ # React life game | ||
![lifegame](https://user-images.githubusercontent.com/38521709/151685605-dc13fa60-8e27-441c-8844-f38f9c7b14e9.gif) | ||
![lifegame](https://user-images.githubusercontent.com/38521709/151694896-8fd8d457-5c9d-411d-bd38-80d0a372c078.gif) | ||
@@ -55,1 +55,17 @@ ## Installation | ||
| height | numer | Height of the field of game of life | window.innerHeight | | ||
### tips | ||
#### Re-render on window resize | ||
By default, this component is **not** resizable. | ||
To support window resize, you need to use `key` prop for this component generated by `useKeyOnResize` hook. | ||
```jsx | ||
import { LifeGameField, useKeyOnResize } from 'react-life-game'; | ||
function App() { | ||
const { key } = useKeyOnResize(); | ||
return <LifeGameField key={key} option={{...}} />; | ||
} | ||
``` |
21500
70