diff --git a/docs/src/examples/elements/Button/Usage/ButtonExampleFocus.js b/docs/src/examples/elements/Button/Usage/ButtonExampleFocus.js index 63d014e2ef..ba8bfcc64a 100644 --- a/docs/src/examples/elements/Button/Usage/ButtonExampleFocus.js +++ b/docs/src/examples/elements/Button/Usage/ButtonExampleFocus.js @@ -1,16 +1,19 @@ -import React, { Component } from 'react' +import React, { Component, createRef } from 'react' import { Button, Grid } from 'semantic-ui-react' export default class ButtonExampleFocus extends Component { - handleClick = () => this.ref.focus() - - handleRef = c => (this.ref = c) + buttonRef = createRef() + handleClick = () => this.buttonRef.current.focus() render() { return ( -