This repo has the examples of ReactJS 19 new features:
-
Action
-
useFormState()
-
useFormStatus()
-
useOptimistic()
-
use() for fetch
-
use() for context()
-
Clone the repo and run
npm i
-
Once node_modules are generated now run the dev server
npm run dev
-
Go to browser and run localhost (as mentioned in the terminal)
-
Go to App.jsx and uncomment/comment the specific example you want to hide/run
-
Component and features:
-
Action: to show how action works in React19
-
FormState: to show how useFormState() works in React19
-
FormStatus: to show how useFormStatus() works in React19
-
Optimistic: to show how useOptimistic() works in React19
-
Theme: to show how to use() with context() in React19
-
Users: to show how to use() for API calls in React19
PS: While writing these code these examples were working. As ReactJS 19 is still WIP please update the version accrodingly.