Skip to content

Commit 38dfc8d

Browse files
CodinCatclaydiffrient
authored andcommitted
Use callback ref in readme
1 parent ea3e536 commit 38dfc8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class App extends React.Component {
176176

177177
afterOpenModal() {
178178
// references are now sync'd and can be accessed.
179-
this.refs.subtitle.style.color = '#f00';
179+
this.subtitle.style.color = '#f00';
180180
}
181181

182182
closeModal() {
@@ -195,7 +195,7 @@ class App extends React.Component {
195195
contentLabel="Example Modal"
196196
>
197197

198-
<h2 ref="subtitle">Hello</h2>
198+
<h2 ref={subtitle => this.subtitle = subtitle}>Hello</h2>
199199
<button onClick={this.closeModal}>close</button>
200200
<div>I am a modal</div>
201201
<form>

0 commit comments

Comments
 (0)