Skip to content

Commit 73ba23f

Browse files
committed
Updated createRef example not to use class property syntax
1 parent 99d5ce4 commit 73ba23f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

examples/16-3-release-blog-post/create-ref-example.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
class MyComponent extends React.Component {
2-
// highlight-next-line
3-
inputRef = React.createRef();
2+
constructor(props) {
3+
super(props);
4+
5+
// highlight-next-line
6+
this.inputRef = React.createRef();
7+
}
48

59
render() {
610
// highlight-next-line

0 commit comments

Comments
 (0)