Skip to content

Instantly share code, notes, and snippets.

@gaperton
Last active May 17, 2019 04:37
Show Gist options
  • Save gaperton/2f6aadceaedd36bebe8895068c5306c5 to your computer and use it in GitHub Desktop.
Save gaperton/2f6aadceaedd36bebe8895068c5306c5 to your computer and use it in GitHub Desktop.
const PickUser = ({ selected, setSelected }) => {
// Declare the local component's state.
const [ editing, setEditing ] = useState( false );
return (
<div>
{ editing ?
<EditUser selected={selected} setSelected={setSelected}
close={() => setEditing( false )}/>
:
<input value={ userToString( selected ) }
onClick={ () => setEditing( true ) }/>
}
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment