Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Fragment } from 'react';
- import Input from './Input';
- const App = () => (
- <div>
- <h1> Enter your name below</h1>
- <Input
- render={({ name, handleSubmit, handleChange }) => (
- <Fragment>
- Current Name: {name}
- <form onSubmit={handleSubmit}>
- <label>
- Name:
- <input type="text" value={name} onChange={handleChange} />
- </label>
- <input type="submit" value="Submit" />
- </form>
- </Fragment>
- )}
- />
- </div>
- );
- export default App;
Add Comment
Please, Sign In to add comment