I hereby claim:
- I am jeanbauer on github.
- I am jeanbauer (https://keybase.io/jeanbauer) on keybase.
- I have a public key ASDC4KuyhEyvQCn_yguIMXgHN7XotjmC8_slacrZ22sHWgo
To claim this, I am signing this object:
Invariant Violation: Hooks can only be called inside the body of a function component. | |
2 | | |
3 | export function useFormField(initialValue) { | |
> 4 | const [value, setValue] = useState(initialValue) | |
| ^ | |
5 | | |
6 | function onChange(e) { | |
7 | setValue(e.target.value) |
// Usage - client: | |
useEffect(() => { | |
subscribe('users', setUsers) | |
subscribe('messages', setMessages) | |
} | |
// Subscribe implementation | |
export function subscribe(collection, onDataReceive) { | |
db.collection(collection) |
import { useState } from 'react' | |
const Form = () => { | |
const name = useFormInput('Name') | |
return ( | |
<> | |
<input {...name} /> | |
</> | |
) |
I hereby claim:
To claim this, I am signing this object:
### Keybase proof | |
I hereby claim: | |
* I am jeanbauer on github. | |
* I am jeanbauer (https://keybase.io/jeanbauer) on keybase. | |
* I have a public key ASDC4KuyhEyvQCn_yguIMXgHN7XotjmC8_slacrZ22sHWgo | |
To claim this, I am signing this object: |