Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //App.js
  2.  
  3. import Button from Button.js
  4.  
  5. class App {
  6.     ref = React.createRef();
  7.  
  8.     componenentDidMount() {
  9.         this.button.focus();
  10.     }
  11.  
  12.     render() {
  13.         return (<InputText ref={this.button}/>);
  14.     }
  15. }
  16.  
  17. //InputText.js
  18. export default class InputText {
  19.     render() {
  20.         return (<input type="text"/>);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement