Guest User

Untitled

a guest
Jul 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import React, { PropTypes, Component } from 'react';
  2. import Validator from 'validator';
  3.  
  4. class App extends React.Component{
  5. constructor(){
  6. super();
  7. this.state = {
  8. nickName:'David',
  9. valid: false,
  10. };
  11. };
  12.  
  13. submit = () => {
  14. const validator = new Validator({
  15. nickName: 'Frank',
  16. });
  17. validator.validate();
  18. }
  19.  
  20. render() {
  21. return (
  22. <div>
  23. <h1>{this.state.firstName}</h1>
  24. <h1>{this.state.lastName}</h1>
  25. </div>
  26. );
  27. };
  28. }
  29.  
  30. ReactDOM.render(<App />, document.getElementById('react-state'));
Add Comment
Please, Sign In to add comment