Created
August 27, 2019 12:27
-
-
Save julianwachholz/a8cdd31ecf40c2008b5be7cb8f836fcf to your computer and use it in GitHub Desktop.
This file contains 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
const MyForm: React.FC<any> = observer(({match, store}) => { | |
const obj = store.get(match.params.id); | |
if (obj === null) { | |
return <MyLoadingForm />; | |
} | |
// Invariant violation: Rendered more hooks than during the previous render. | |
const [data, setData] = useState(obj.data); | |
return <MyLoadedForm data={data} onSubmit={setData} /> | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment