Skip to content

Instantly share code, notes, and snippets.

@aakashns
Created October 27, 2015 20:26
Show Gist options
  • Select an option

  • Save aakashns/23a8442b2b2d48441427 to your computer and use it in GitHub Desktop.

Select an option

Save aakashns/23a8442b2b2d48441427 to your computer and use it in GitHub Desktop.
View for the Web version of Name
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