Skip to content

Commit

Permalink
fix: apply effect fix to hooks version of dragpreview
Browse files Browse the repository at this point in the history
  • Loading branch information
darthtrevino committed Mar 26, 2019
1 parent a608c5e commit fdf3cf3
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -18,10 +18,13 @@ export interface BoxDragPreviewState {
const BoxDragPreview: React.FC<BoxDragPreviewProps> = memo(({ title }) => {
const [tickTock, setTickTock] = useState(false)

useEffect(function subscribeToIntervalTick() {
const interval = setInterval(() => setTickTock(!tickTock), 500)
return () => clearInterval(interval)
}, [])
useEffect(
function subscribeToIntervalTick() {
const interval = setInterval(() => setTickTock(!tickTock), 500)
return () => clearInterval(interval)
},
[tickTock],
)

return (
<div style={styles}>
Expand Down

0 comments on commit fdf3cf3

Please sign in to comment.