useFlashSession hook reads session data and subsequently clears it in server components.
Example codeAnchor link to section titled "Example code"
Return valueAnchor link to section titled "Return value"
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.
ConsiderationsAnchor link to section titled "Considerations"
useFlashSession hook is best used for form validation in the