Skip to content

Commit

Permalink
Trying to resolve issue with Invalid hook call being triggered from u…
Browse files Browse the repository at this point in the history
…se-font-face-observer, v1.3.2
  • Loading branch information
scottcanoni committed Jan 25, 2023
1 parent 42333c2 commit c9c1aaa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-anagram-animation",
"version": "1.3.1",
"version": "1.3.2",
"author": "Scott Canoni",
"description": "A React component to use CSS animations to swap letters in 2 words which are an anagram of each other. The text is animated in position after calculating initial and final positions of each letter.",
"license": "WTFPL",
Expand Down
10 changes: 4 additions & 6 deletions src/lib/components/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ import './index.css';
* @returns {JSX.Element|null}
*/
export default function Loader ({ words = DEFAULT_WORDS, animationOptions = {}, fontToObserve }) {
const animOptions = {
...DEFAULT_ANIMATION_OPTIONS,
...animationOptions,
};

const isFontLoaded = useFontFaceObserver(fontToObserve ? [fontToObserve] : []);

return isFontLoaded ? <Anagram words={words} animationOptions={animOptions} /> : null;
return isFontLoaded ? <Anagram words={words} animationOptions={{
...DEFAULT_ANIMATION_OPTIONS,
...animationOptions,
}} /> : null;
}

0 comments on commit c9c1aaa

Please sign in to comment.