Skip to content

Commit

Permalink
[docs] Minor Hook Demo fixes (#14367)
Browse files Browse the repository at this point in the history
* Fix CircularStatic hook demo

* Change useEffect to componentDidMount/willUnmount equivalent
  • Loading branch information
joshwooding authored and oliviertassinari committed Feb 1, 2019
1 parent 5d82585 commit cdfcad3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/pages/demos/progress/CircularDeterminate.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function CircularDeterminate() {
return () => {
clearInterval(timer);
};
});
}, []);

return (
<div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/progress/CircularStatic.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function CircularStatic() {
setCompleted(prevCompleted => (prevCompleted >= 100 ? 0 : prevCompleted + 10));
}

React.useState(() => {
React.useEffect(() => {
const timer = setInterval(progress, 1000);
return () => {
clearInterval(timer);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/progress/LinearBuffer.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function LinearBuffer() {
return () => {
clearInterval(timer);
};
});
}, []);

return (
<div className={classes.root}>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/progress/LinearDeterminate.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function LinearDeterminate() {
return () => {
clearInterval(timer);
};
});
}, []);

return (
<div className={classes.root}>
Expand Down

0 comments on commit cdfcad3

Please sign in to comment.