Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Value to be any type instead of the union string | number | string[] #11

Closed
emi2k01 opened this issue Aug 5, 2022 · 3 comments · Fixed by #13
Closed

Allow Value to be any type instead of the union string | number | string[] #11

emi2k01 opened this issue Aug 5, 2022 · 3 comments · Fixed by #13
Labels

Comments

@emi2k01
Copy link

emi2k01 commented Aug 5, 2022

Is your feature request related to a problem? Please describe.
I have some fields whose value is an ID to an object but I store another value from the object to show the user. So I'd like to do something like:

user: fieldAtom(value: {
  id: null,
  name: "",
})

This way, I can update the values atomically.

Describe the solution you'd like
I would like to be able to add any value to a fieldAtom and be able to use them with components such as Field.

Describe alternatives you've considered
Use two fields.

Additional context
...

@jaredLunde
Copy link
Collaborator

It might be a mistake on my part that <Field> has this restriction. I think that should only apply to <InputField> where there are onChange and onBlur prop dependencies. It's definitely the intent that <Field> be a less restrictive component.

jaredLunde added a commit that referenced this issue Aug 7, 2022
github-actions bot pushed a commit that referenced this issue Aug 7, 2022
## [1.2.5](v1.2.4...v1.2.5) (2022-08-07)

### Bug Fixes

* **types:** fix types for Field component ([#13](#13)) ([cdc1917](cdc1917)), closes [#11](#11)
@github-actions
Copy link

github-actions bot commented Aug 7, 2022

🎉 This issue has been resolved in version 1.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@emi2k01
Copy link
Author

emi2k01 commented Aug 8, 2022

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants