Skip to content

add useRef notes per #388 #389

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Jan 27, 2021
Merged

add useRef notes per #388 #389

merged 3 commits into from
Jan 27, 2021

Conversation

swyxio
Copy link
Collaborator

@swyxio swyxio commented Jan 26, 2021

closes #388

by clarifying the 3 kinds of ways to use useRef.

@@ -130,10 +130,13 @@ When using `useRef`, you have two options when creating a ref container that doe

```ts
const ref1 = useRef<HTMLElement>(null!);
const ref2 = useRef<HTMLElement>(null);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two ref2 variables?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, i fixed

@swyxio swyxio merged commit 9b224b6 into main Jan 27, 2021
@swyxio swyxio deleted the sw-yx-patch-2 branch January 27, 2021 23:52
@rajivpunjabi
Copy link

Updated documentation is not yet visible.

@swyxio
Copy link
Collaborator Author

swyxio commented Feb 1, 2021

image
the build was failing because of this PR without codefence.. fixing now

@swyxio
Copy link
Collaborator Author

swyxio commented Feb 1, 2021

fixed https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/hooks/#useref

@rajivpunjabi
Copy link

Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Basic] useRef Hook Documentation.
2 participants