Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import React from "react";
  2.  
  3. class App extends React.Component {
  4. constructor(props) {
  5. super(props);
  6. this.state = {
  7. value: ""
  8. }
  9. }
  10.  
  11. onChange(e){
  12. this.state({
  13. value: e.target.value
  14. })
  15. }
  16.  
  17. render(){
  18. return(
  19. <div>
  20. <input type="text" onChange={(e) => this.onChange(e)}/>
  21. </div>
  22. )
  23. }
  24.  
  25. }
  26.  
  27. export default App
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement