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

jsx/dom : Improve compatibility with React 19 #2959

Closed
10 tasks done
usualoma opened this issue Jun 11, 2024 · 10 comments
Closed
10 tasks done

jsx/dom : Improve compatibility with React 19 #2959

usualoma opened this issue Jun 11, 2024 · 10 comments
Labels
enhancement New feature or request.

Comments

@usualoma
Copy link
Member

usualoma commented Jun 11, 2024

What is the feature you are proposing?

https://react.dev/blog/2024/04/25/react-19

@usualoma usualoma added the enhancement New feature or request. label Jun 11, 2024
@usualoma
Copy link
Member Author

Hi @yusukebe
Please create a "react-19-compat" branch. Merge each PR into it, and when it's all together, we can merge "react-19-compat" into "main" or "next".

@yusukebe
Copy link
Member

@yusukebe
Copy link
Member

I want to have the form.

@usualoma
Copy link
Member Author

@yusukebe

Thank you! > react-19-compat

I've added the "form with useActionState, useFormStatus, useOptimistic" to the to-do list!

@yusukebe
Copy link
Member

Thanks @usualoma !

I like the action attribute in form, though I've never used React 19 so many times. This makes handling a form action very simple.

export default function Form() {
  async function action(formData: FormData) {
    const query = formData.get('query')?.toString() ?? 'no query'
    console.log(query)
  }
  return (
    <form action={action}>
      <input name="query" />
      <button type="submit">Submit</button>
    </form>
  )
}

@usualoma
Copy link
Member Author

'Support for preloading resources' is a bit tricky compared to the existing JSX behaviour, so I'd like to put it on the back burner and perfect the other features.

@yusukebe
Copy link
Member

yusukebe commented Jul 1, 2024

Hey @usualoma

I think we can close this issue now.

@usualoma
Copy link
Member Author

usualoma commented Jul 1, 2024

Yes, let's close this!

@usualoma
Copy link
Member Author

usualoma commented Jul 1, 2024

The following was not implemented but will be considered separately if requested.
Support for preloading resources

I close this issue as the others have been implemented.

@usualoma usualoma closed this as completed Jul 1, 2024
@sor4chi
Copy link
Contributor

sor4chi commented Jul 8, 2024

From React 19, there is an additional function for allocating arrays for caching used by React Compiler under the module name react/compiler-runtime, is it correct to assume that this does not directly affect React 19 compatibility and therefore is not provided?

The default value of the so-called React Compiler's runtimeModule option is react/compiler-runtime, which is the module to use there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

3 participants