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

Refactor certain portions of the ParameterEditor #2124

Open
anth-volk opened this issue Oct 22, 2024 · 0 comments
Open

Refactor certain portions of the ParameterEditor #2124

anth-volk opened this issue Oct 22, 2024 · 0 comments

Comments

@anth-volk
Copy link
Collaborator

There are parts of the component that work, but that I don't particularly like.

The biggest issue is that we use effect hooks throughout because the component never technically unmounts when switching between input types and/or parameters. This makes it very easy to create unforeseen bugs, and also makes state management challenging. For example, there's a point in the default input method where an effect hook is partly meant to essentially prevent the behavior of the main ParameterEditor component's own effect hook, which is necessary for yearly and date-based inputs.

There's probably a way to redo this so that state management is clearer and effect hooks are minimized. I'd theorize we'd need at least one, meant to update values when a reform already exists, but that should really be the max. I think we have like 7 in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant