Skip to content

Update useImagesLoaded.js - #2

Open
juzhiyuan wants to merge 1 commit into
frzkn:masterfrom
juzhiyuan:patch-1
Open

Update useImagesLoaded.js#2
juzhiyuan wants to merge 1 commit into
frzkn:masterfrom
juzhiyuan:patch-1

Conversation

@juzhiyuan

Copy link
Copy Markdown

use useRef instead of useState

use useRef instead of useState
@frzkn

frzkn commented Jul 11, 2020

Copy link
Copy Markdown
Owner

Hey @juzhiyuan thanks for your interest in the project!

Using useState instead of useRef was intentional, changes to ref do not cause a re-render therefore the hook will not rerun unless the state changes.

Try it in the example page to know more.

@juzhiyuan

Copy link
Copy Markdown
Author

🤔 Not sure, I test this library with useRef on Codesandbox, and it works.

@juzhiyuan

Copy link
Copy Markdown
Author

Could you please provide more info between ref and state when you are free?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants