-
Notifications
You must be signed in to change notification settings - Fork 48.3k
[New Docs] Docs Bugs & Issues #8035
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
Comments
Docs on Component API are 404ing: https://facebook.github.io/react/docs/component-specs.html#updating-componentwillreceiveprops |
Yea, something happened to |
@luqmaan Thanks, fixed. Let us know if you find more broken links. |
On Hello World,
|
Great job on new docs all, love the live editor with error handling. Just curious: Any reason why |
Another thing I noticed: this might of been an issue with the old docs but syntax errors don't have correct formatting of newlines from babel-code-frame Someone can make a pr to add to add Line 224 in eb118b7
.playgroundError css class in https://github.com/facebook/react/blob/15-dev/docs/css/react.scss (<pre> seems to make it go over the width limit of the colored error box)
Width would need to be longer to be accurate but it would be better than before |
No reason, feel free to send a PR fixing this. |
If this is the "new style" I think you should point out the key differences to the "old style". |
Does it matter at this point? It's not as much style as a lack of cohesion in previous docs. They weren't really grouped by topic, there was no clear progression from simple to complex, their titles weren't descriptive, there were many random "tips" that didn't fit a cohesive narrative, they were using APIs that aren't used widely in the ecosystem anymore, etc. New docs are in line with how people use React today, have descriptive titles, and a linear progression from simple to more complex topics. That's the basic difference. |
Possible typo in docs: "Consider the ticking clock example from the one of the previous sections." https://facebook.github.io/react/docs/state-and-lifecycle.html |
@gaearon the uncontrolled form example on https://facebook.github.io/react/docs/forms.html#uncontrolled-components is passing value, so it's actually a controlled example. The correct example would be something like: class Form extends React.Component {
constructor(props) {
super(props);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit(event) {
alert("Text field value is: '" + this.textInput.value + "'");
}
render() {
return (
<div>
<input
type="text"
placeholder="Hello!"
ref={(input) => this.textInput = input}
/>
<button onClick={this.handleSubmit}>Submit</button>
</div>
);
}
}
ReactDOM.render(<Form />, document.getElementById('root')); |
// Calls the children callback numTimes to produce a repeated component
function Repeat(props) {
var items = [];
for (var i = 0; i < numTimes; i++) {
// ...
} Here |
Why was info about latest stable removed from landing page? |
@Andreyco What do you mean? There was a "Download Starter Kit" link that mentioned version but most people didn't find that "starter kit" useful. You can always find the latest version on Releases GH page. |
Another feedback on "Controlled Components": #8052 |
@gaearon Yes, I mean link that mentioned version. I don't care about link, I am interested in version information. Anyway, no big deal, I will search for latest in GH releases. TY. |
Merged a bunch of PRs with fixes. Keep them coming please! |
https://facebook.github.io/react/blog/2016/07/22/create-apps-with-no-configuration.html looks very weird on mobile, with some sort of a broken top bar |
Feedback on tutorial https://twitter.com/iandavey773/status/789870405389475840 |
Figure out if we do redirects correctly https://twitter.com/spiceee/status/789774523549745152 |
@giuseppeg No idea, want to send a PR so I better understand the difference? |
More feedback: people are used to seeing version number on homepage. Can we add it somewhere and also link to the changelog for good measure? |
Just reading though the "React Without ES6" page:
Perhaps it's worth mentioning that this only applies in event handlers. Otherwise |
@simonsmith Sounds good. |
@simonsmith @gaearon I don't think that's true if I'm understanding you correctly. You need to bind your method anytime it might be executed in a context where class Bar extends React.Component {
constructor(props) {
super(props);
// this will throw since it tries to access this.state.foo and
// this.state is undefined on Bar
this.props.logFoo();
}
render() {
return <h1>Bar</h1>
}
}
class Foo extends React.Component {
constructor(props) {
super(props);
this.state = {
foo: "foo"
};
}
logFoo() {
console.log("Foo is: ", this.state.foo);
}
render() {
return <Bar logFoo={this.logFoo} />
}
} An event handler is the most common case, but it's not the only case where you need to bind methods. |
The rule of thumb is that if you access method anywhere without |
Is that in the docs? If not, it should be 😄 |
PRs welcome! |
@aweary Yeah, my point was the docs imply you need to use I've seen code where every method was bound by hand even if it was just being called normally. I can see why people might think that was correct. I'll put together some changes and we can discuss in a PR 👍 |
No mention of the old string-based refs in the new docs. Should these be mentioned in a "deprecated" notice at least? |
@Shenlok They're technically not deprecated yet, just considered legacy. Refs and the DOM does mention them but too briefly:
I agree we should add a small section at the bottom at least describing how string refs work, with a notice that we don't recommend using them. Could you send a PR for this? |
Forms docs has mistakes.
|
(Sorry if this has been discussed elsewhere — I haven't been able to find any references to it though).
I agree there was no narrative here, although at the same time many of these provided really good advice on anti-patterns and things to avoid. At least they have been very valuable to me on the way to learning React. Now as I browse/search through the new docs, I am missing these and I am not sure whether they have been integrated under other sections or discarded by some reason. IMHO having a specific section on anti-patterns can be beneficial for newcomers to avoid making common mistakes (e.g. using props as initial state), as well as a reference to be able to point to others. |
@julen All valuable tips were integrated into the relevant content. There aren't many "antipatterns" in React despite what some people say. If something is "bad" we try to disallow it on the API level. |
Tiny (possible?) typo: in reference-react.md, the code for |
I was wondering about the example code in https://facebook.github.io/react/docs/thinking-in-react.html#step-4-identify-where-your-state-should-live. I don't really understand why the filtering should be ProductTable's responsibility. Wouldn't it make more sense to do the filtering in FilterableProductTable and just pass the filtered products down to ProductTable? |
@gaearon @aweary I know I am "beating a dead horse" on this (as a similar issue was discussed above in this thread), but after reading the following in the docs in handling events
you walk away thinking that you have to bind class Test {
constructor(){
this.someProperty = "this is a test";
}
hi(){
console.log(`this in hi() = ${JSON.stringify(this)}`);
this.callAnother();
}
callAnother(){
console.log(`this in callAnother() = ${JSON.stringify(this)}`);
}
}
const c = new Test();
c.hi(); which is obviously not true. So, what the paragraph is really trying to say is this, but it needs to do it better... :) |
@kalmanh Send a PR ;-) |
@jayjaycross did you want to fix that typo? If not I'll create a PR |
@kkemple go for it! |
Not sure it is a proper place to post it, but "React documentation is Creative Commons licensed." in the end of |
yeah, I think the licence-doc was removed by this commit cfaa072 , maybe we can remove the |
The documentation and source code for reactjs.org now lives in a different repository: reactjs/reactjs.org. (For more info on why we made this move, see issue #11075.) I've moved this issue to the new repo: reactjs/react.dev#84 Let's continue the discussion there! |
@bvaughn The |
We just completely rewrote docs in #7864.
They're bound to cause some issues, have some mistakes, etc.
Let's keep this issue as an umbrella for all problems we're discovering after the initial rollout.
https://facebook.github.io/react/index.html
which is ugly URLNumber
as an identifier docs: list and key examples override Number #8034Story1
,render2
@lacker<hello>
tag but doesn't show how to fix it @lackermockComponent
as legacy and unnecessaryDon't make mockComponent depend on Jest #2499 (comment)
shallowCompare
on Addons page should recommendPureComponent
insteadThe text was updated successfully, but these errors were encountered: