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 claydiffrient committed Apr 21, 2017
1 parent ea3e536 commit 38dfc8d
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 @@ -176,7 +176,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 @@ -195,7 +195,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 38dfc8d

Please sign in to comment.