i need help on type
![No description](https://cdn.answeroverflow.com/1205133557249609739/Screenshot_from_2024-02-08_14-28-29.png)
![No description](https://cdn.answeroverflow.com/1205133557631287346/Screenshot_from_2024-02-08_14-27-50.png)
Solution:Jump to solution
```typescript
export function StoreSetter<T extends keyof StoreType>({
store,
data,
}: {...
29 Replies
bro what
i want to add type to data prop in StoreSetter component
and what’s the issue?
should i send screen shot or copy paste the error
both is fine
ok i did this few min ago and
then this error is shown at top of setAtom(data)
![No description](https://cdn.answeroverflow.com/1205137439379820544/image.png)
Solution
with
StoreSetter({store: 'write2', data: [""]})
i have another request if you dont mind
sure go ahead
its ok, to set setAtom(...data) like that right, when I use useeffect it throws a hydration error because initially, it render empty form then get populated
btw not sure if you really want to pass the parameters as object
you could also do this:
and use it like this:
which i find to be nicer
![No description](https://cdn.answeroverflow.com/1205142670654054420/image.png)
so you want to use it as a component?