Skip to content

Commit

Permalink
feat(components/script/loader): add bracket in the useEffect to avoid…
Browse files Browse the repository at this point in the history
… returning false
  • Loading branch information
xavi-murcia committed Apr 16, 2024
1 parent a7443db commit 9274c98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/script/loader/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const ScriptLoader = ({
.catch(() => seTimeout(true))
}

useEffect(() => timeout && onTimeout(), [onTimeout, timeout])
useEffect(() => {
timeout && onTimeout()
}, [onTimeout, timeout])

useMount(initLoad)

if (readyToRender && render) return render()
Expand Down

0 comments on commit 9274c98

Please sign in to comment.