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

Update @toolpad/core to React 19 #4499

Closed
bharatkashyap opened this issue Dec 2, 2024 · 5 comments · Fixed by #4488
Closed

Update @toolpad/core to React 19 #4499

bharatkashyap opened this issue Dec 2, 2024 · 5 comments · Fixed by #4488
Labels
core Infrastructure work going on behind the scenes React 19 support About improving React 19 support

Comments

@bharatkashyap
Copy link
Member

No description provided.

@bharatkashyap bharatkashyap converted this from a draft issue Dec 2, 2024
@bharatkashyap bharatkashyap added the core Infrastructure work going on behind the scenes label Dec 2, 2024
@jy95
Copy link

jy95 commented Dec 7, 2024

+1

@kirill-konshin
Copy link

kirill-konshin commented Dec 29, 2024

At the very least the return from useActionState should be compatible with signIn prop of SignInPage:

const [whatever, action, isPending] = useActionState(
  async (_, formData) => {
    // logic
  },
  {},
);

// this one works but emits error in console
<SignInPage signIn={(provider, formData) => action(formData)} />

// this one results in full screen error
<SignInPage signIn={action} />

Error: An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an action prop, or dispatch manually inside startTransition

@suren-atoyan
Copy link

@oliviertassinari any plans on this?

@bharatkashyap
Copy link
Member Author

At the very least the return from useActionState should be compatible with signIn prop of SignInPage:

const [whatever, action, isPending] = useActionState(
  async (_, formData) => {
    // logic
  },
  {},
);

// this one works but emits error in console
<SignInPage signIn={(provider, formData) => action(formData)} />

// this one results in full screen error
<SignInPage signIn={action} />

Error: An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an action prop, or dispatch manually inside startTransition

@oliviertassinari any plans on this?

Supporting useActionState, useFormStatus and other form related React 19 hooks is planned after the React 19 upgrade PR (#4488) is merged and released next week

@oliviertassinari oliviertassinari added the React 19 support About improving React 19 support label Jan 3, 2025
@github-project-automation github-project-automation bot moved this from In progress to Completed in MUI Toolpad public roadmap Jan 10, 2025
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes React 19 support About improving React 19 support
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

5 participants