Skip to content

Commit

Permalink
Fix: icon resize with animate false (#17)
Browse files Browse the repository at this point in the history
Fixing #16

    Added size to the dependencies
    Instantiating the class with resizeClear: true
  • Loading branch information
georgelioris authored Apr 5, 2020
1 parent 92e03c7 commit 2f28a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ReactAnimatedWeather.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const ReactAnimatedWeather = ({
const skyconCanvas = useRef(null);

useEffect(() => {
const skyconIcon = new Skycons({ color });
const skyconIcon = new Skycons({ color, resizeClear: true });
const canvas = skyconCanvas.current;
setIcon(icon, animate, skyconIcon, canvas);

return () => {
skyconIcon.remove(canvas);
};
}, [icon, color, animate]);
}, [icon, color, animate, size]);

return <canvas ref={skyconCanvas} width={size} height={size} />;
};
Expand Down

0 comments on commit 2f28a0e

Please sign in to comment.