-
Notifications
You must be signed in to change notification settings - Fork 49.4k
Documentation for stateless functions/components, condensed two pages about refs into one #4964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for stateless functions/components, condensed two pages about refs into one #4964
Conversation
f28ac0f
to
0295ff6
Compare
0295ff6
to
1a53e82
Compare
Added documentation for stateless components, as per conversation with @spicyj. |
1a53e82
to
133ff81
Compare
docs/docs/08.1-more-about-refs.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call it "Refs to Components" here (and in the sidebar, if that's specified somewhere else)?
80eab35
to
1c1e7b4
Compare
@spicyj Fixed, ready to go? |
1c1e7b4
to
e3821e7
Compare
docs/docs/08.1-more-about-refs.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be ref={(ref) => this.myTextInput = ref}
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this should just be ref="myTextInput"
since we're talking about string refs.
docs/docs/05-reusable-components.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally this isn't an issue, since stateless functions do not provide an imperative API, there really isn't much you could do with an instance anyway.
This doesn't parse as a sentence to me. Maybe split into 2 sentences at the first comma?
docs/docs/05-reusable-components.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nit (that I shouldn't actually care much about but that tiny bit of OCD in my brain decided to notice): the rest of our docs uses a single space after periods in a sentence. You used 2 (and not entirely consistently at that). I'm sure you'll ignore this and that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, one space for proportional fonts and two spaces for monospace fonts leaves it ambiguous what to do when you're writing .md which will turn into HTML. I went ahead and changed this file to single-space, though we aren't exactly consistent throughout the rest of our docs :).
e3821e7
to
f7000b9
Compare
Good to go? |
f7000b9
to
10ea270
Compare
docs/docs/08.1-more-about-refs.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: leading whitespace is still here (and in the next paragraph, and the one after that… and the one after that but you didn't add that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
… about refs into a single page.
10ea270
to
5ee8a93
Compare
👍 |
Documentation for stateless functions/components, condensed two pages about refs into one
Condensed the two refs pages into a single refs page, added a note about stateless components having null references.