Skip to content

Commit a5cc01b

Browse files
CodinCatdiasbruno
authored andcommitted
Use callback ref in readme
1 parent 933f3a4 commit a5cc01b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class App extends React.Component {
196196

197197
afterOpenModal() {
198198
// references are now sync'd and can be accessed.
199-
this.refs.subtitle.style.color = '#f00';
199+
this.subtitle.style.color = '#f00';
200200
}
201201

202202
closeModal() {
@@ -215,7 +215,7 @@ class App extends React.Component {
215215
contentLabel="Example Modal"
216216
>
217217

218-
<h2 ref="subtitle">Hello</h2>
218+
<h2 ref={subtitle => this.subtitle = subtitle}>Hello</h2>
219219
<button onClick={this.closeModal}>close</button>
220220
<div>I am a modal</div>
221221
<form>

0 commit comments

Comments
 (0)