Created
October 27, 2015 20:26
-
-
Save aakashns/23a8442b2b2d48441427 to your computer and use it in GitHub Desktop.
View for the Web version of Name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| var NameViewWeb = ({ value, errors, sync, onValueChange }) => { | |
| var errorNodes = errors.map((err, i) => <div key={i}>{err}</div>); | |
| var syncNode = value && <div>{ sync ? "Synced!" : "Syncing..." }</div>; | |
| return (<div> | |
| <label>Name : </label> | |
| <input type="text" value={value} | |
| onChange={e => onValueChange(e.target.value)} /> | |
| {errorNodes} | |
| {syncNode} | |
| </div>); | |
| }; | |
| export default NameViewWeb; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment