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 django_form on_error event sometimes not occurring #272

Open
Archmonger opened this issue Dec 11, 2024 · 0 comments
Open

Fix django_form on_error event sometimes not occurring #272

Archmonger opened this issue Dec 11, 2024 · 0 comments

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Dec 11, 2024

Current Situation

Sometimes django_form events such as on_error will not be executed.

This appears to be caused by a race condition where the use_effect(render_form) hook could be cancelled prior to full execution.

It is presumed that this issue is related to current ReactPy use_effect design that cancels all async effects upon every re-render. The set_state function queues a render, and fact that set_state is asynchronously being called in several locations within the django_form component is likely causing abrupt re-renders (which subsequently causes early use_effect termination).

Proposed Actions

This issue will likely need to be resolved in ReactPy core, and might require creating an effect rendering queue on a per-component basis.

Related PR: reactive-python/reactpy#1169

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

No branches or pull requests

1 participant