Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rphlmr/aa4a3d635d21394bfcbff5e6359d630c to your computer and use it in GitHub Desktop.
Save rphlmr/aa4a3d635d21394bfcbff5e6359d630c to your computer and use it in GitHub Desktop.
Remix Run Firefox Warning: Prop `disabled` did not match. Server: "null" Client: "true"

When you have a Form (Remix) whith a <button type="submit" disabled={disabled}>, Firefox results in hydratation error Prop 'disabled' did not match. Server: "null" Client: "true".

To solve this issue, just add autoComplete="off" on your Form

Doesn't work with Firefox (103.0.2)

const [isDisabled, setIsDisabled] = useState(false);

// ...

<Form method="post">
  {/* ... */}
  <button type="submit" disabled={isDisabled}>Continue</button>
</Form>

Works with Firefox (103.0.2)

const [isDisabled, setIsDisabled] = useState(false);

// ...

<Form method="post" autoComplete="off">
  {/* ... */}
  <button type="submit" disabled={isDisabled}>Continue</button>
</Form>

Source : vercel/next.js#35558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment