javascript
javascript copied to clipboard
[react] [readme] Fix broken documentation links and syntax error in code example
Description
The React/JSX Style Guide (react/README.md) contains 3 broken external links and 1 syntax error in a code example.
Broken Links (all return HTTP 404)
All three facebook.github.io/react URLs are dead — React's docs moved to react.dev and the legacy blog content is now at legacy.reactjs.org.
| Line | Broken URL | Status |
|---|---|---|
| 28 | https://facebook.github.io/react/docs/reusable-components.html#stateless-functions |
❌ 404 |
| 78 | https://facebook.github.io/react/blog/2016/07/13/mixins-considered-harmful.html |
❌ 404 |
| 738 | https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html |
❌ 404 |
Working replacements (verified):
legacy.reactjs.org/docs/react-without-es6.html✅ 200legacy.reactjs.org/blog/2016/07/13/mixins-considered-harmful.html✅ 200legacy.reactjs.org/blog/2015/12/16/ismounted-antipattern.html✅ 200
Syntax Error in Code Example (Line 457)
The "Spreading objects with known, explicit props" example has invalid JavaScript — function Foo is missing its parameter parentheses ():
// Current (SyntaxError — won't parse)
export default function Foo {
const props = { text: '', isPublished: false }
return (<div {...props} />);
}
// Fixed
export default function Foo() {
const props = { text: '', isPublished: false }
return (<div {...props} />);
}
I'm not sure why this issue is needed since the PR covers it.