Add comment about rendering all form fields to DOM

This commit is contained in:
Gary Tou 2025-03-06 14:53:02 -08:00
parent 39926188c5
commit 3bc355f347
No known key found for this signature in database
GPG key ID: 1587ABD3593755C3

View file

@ -9,7 +9,10 @@ export default function MultiStepForm({ children, submitButton }) {
return (
<>
{/* Render current step */}
{/*
We must render all form fields to DOM so that they can be submitted
with the form. So, we simple hide all non-current steps.
*/}
{steps.map((stepComponent, index) => (
<Box key={index} sx={step !== index ? { display: 'none' } : {}}>
{stepComponent}