Browse Source

Fix example

main
Dan 6 years ago
parent
commit
e89ad6306b
  1. 4
      content/docs/refs-and-the-dom.md

4
content/docs/refs-and-the-dom.md

@ -143,7 +143,7 @@ class CustomTextInput extends React.Component {
**You may not use the `ref` attribute on function components** because they don't have instances: **You may not use the `ref` attribute on function components** because they don't have instances:
```javascript{1,8,13} ```javascript{1,8,13}
function MyFunctionalComponent() { function MyFunctionComponent() {
return <input />; return <input />;
} }
@ -155,7 +155,7 @@ class Parent extends React.Component {
render() { render() {
// This will *not* work! // This will *not* work!
return ( return (
<MyFunctionalComponent ref={this.textInput} /> <MyFunctionComponent ref={this.textInput} />
); );
} }
} }

Loading…
Cancel
Save