Skip to content

Commit

Permalink
Use callback ref in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
CodinCat authored and diasbruno committed Jun 15, 2017
1 parent 933f3a4 commit a5cc01b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class App extends React.Component {

afterOpenModal() {
// references are now sync'd and can be accessed.
this.refs.subtitle.style.color = '#f00';
this.subtitle.style.color = '#f00';
}

closeModal() {
Expand All @@ -215,7 +215,7 @@ class App extends React.Component {
contentLabel="Example Modal"
>

<h2 ref="subtitle">Hello</h2>
<h2 ref={subtitle => this.subtitle = subtitle}>Hello</h2>
<button onClick={this.closeModal}>close</button>
<div>I am a modal</div>
<form>
Expand Down

0 comments on commit a5cc01b

Please sign in to comment.