useFlashSession
The useFlashSession
hook reads session data and subsequently clears it in server components.
Example code
Anchor link to section titled "Example code"
Return value
Anchor link to section titled "Return value"The useFlashSession
hook returns data from the session. It also clears that data so that it will be gone the next time that it's read.
Considerations
Anchor link to section titled "Considerations"The useFlashSession
hook is best used for form validation in the Form
component.