Skip to content

Commit f92e818

Browse files
React example review
1 parent ae171f5 commit f92e818

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/tutorials/usage-with-react.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Assign your animation to an `useRef` immutable object inside a `useEffect` hook.
1919

2020
## Install packages
2121

22-
Start with installing React, ReactDOM and @mojs/core from your package manager of choice. Here we use npm:
22+
Start by installing React, ReactDOM and @mojs/core from your favorite package manager. Here we use npm:
2323

2424
```bash
2525
npm i react react-dom @mojs/core
@@ -177,7 +177,7 @@ const MojsExample = () => {
177177
export default MojsExample;
178178
```
179179

180-
Now lets add a button to play the animation when we click it. To control the animation, we can now reference the MoJS animation like this: `bouncyCircle.current.play();`
180+
Now lets add a button to play the animation when we click it. To control the animation, we can now reference the MoJS animation using `bouncyCircle.current.play();`
181181

182182
```js{19-21,25-27}
183183
const MojsExample = () => {
@@ -265,7 +265,7 @@ const MojsExample = ({ duration }) => {
265265
};
266266
```
267267

268-
As a final touch, lets add some methods to lissen some animation events, and use Reacts useState to save it as a local state:
268+
As a final touch, lets add some methods to listen animation events, and use Reacts useState to save it as a local state:
269269

270270
```js{4-5,18-23,30-33,38-40,45}
271271
const MojsExample = ({ duration }) => {
@@ -340,6 +340,7 @@ ReactDOM.render(
340340
);
341341
```
342342

343-
You can see the full example and try it out here: [CodeSandbox](https://codesandbox.io/s/mojs-react-example-kbikb?file=/src/MojsExample.js). There is also an [example of a button](https://codesandbox.io/s/mojs-react-example-kbikb?file=/src/Button.js) with a `Burst` animation using an object pooling array.
343+
You can see the full example and try it out here: [CodeSandbox](https://codesandbox.io/s/mojs-react-example-kbikb?file=/src/MojsExample.js).
344+
There is also a [button example](https://codesandbox.io/s/mojs-react-example-kbikb?file=/src/Button.js) with a `Burst` animation using an object pooling array.
344345

345-
_If you have any questions, feel free to reach out to us on our [MoJS Slack](https://join.slack.com/t/mojs/shared_invite/zt-dlyxhupt-VR7eV2uwCnvu3Cx~Yc_L9Q), or contact me directly on Twitter: [Jonas Sandstedt](https://twitter.com/jonassandstedt). Happy animating!_
346+
Happy animating!_

0 commit comments

Comments
 (0)