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

fix: proptype errors #607

Merged
2 commits merged into from
Apr 2, 2024
Merged

fix: proptype errors #607

2 commits merged into from
Apr 2, 2024

Conversation

ghost
Copy link

@ghost ghost commented Mar 19, 2024

https://dhis2.atlassian.net/browse/DHIS2-17022

See https://final-form.org/docs/react-final-form/api/Field for the fix I used in the last commit:

Note: To use an array for the values (with another field type, like a tags-input component), you can do value={[...props.input.value]} to avoid "Invalid prop type of 'string' warning"

There are other ways to fix it, like defaultValues or initialValues. But initialValues on a field would override the ones we set on the form, which would prevent us seeding the form with data when editing a queue. And using a defaultValue would mean the form is dirty as soon as it's initialized, which is confusing for users. The fix suggested above is not ideal, but the least bad in my opinion.

@dhis2-bot
Copy link
Contributor

🚀 Deployed on https://pr-607--dhis2-scheduler.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify March 19, 2024 16:12 Inactive
@ghost ghost marked this pull request as ready for review March 20, 2024 11:14
@ghost ghost requested review from a team as code owners March 20, 2024 11:14
@ghost ghost merged commit 13d0160 into master Apr 2, 2024
11 checks passed
@ghost ghost deleted the fix-proptype-errors branch April 2, 2024 12:22
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 101.6.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants