You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/usage-with-react.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Assign your animation to an `useRef` immutable object inside a `useEffect` hook.
19
19
20
20
## Install packages
21
21
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:
23
23
24
24
```bash
25
25
npm i react react-dom @mojs/core
@@ -177,7 +177,7 @@ const MojsExample = () => {
177
177
export default MojsExample;
178
178
```
179
179
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();`
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:
269
269
270
270
```js{4-5,18-23,30-33,38-40,45}
271
271
const MojsExample = ({ duration }) => {
@@ -340,6 +340,7 @@ ReactDOM.render(
340
340
);
341
341
```
342
342
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.
344
345
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!_
0 commit comments