diff --git a/.changeset/nervous-walls-sing.md b/.changeset/nervous-walls-sing.md new file mode 100644 index 00000000000..131618e563f --- /dev/null +++ b/.changeset/nervous-walls-sing.md @@ -0,0 +1,11 @@ +--- +"remix": patch +"@remix-run/deno": patch +"@remix-run/react": patch +--- + +Fix inferred types for `useLoaderData` and `useActionData` to preserve `null`s. + +Previously, `null`s were being replaced by `never`s due to usage of `NonNullable` in `UndefinedOptionals`. +Properties that aren't unions with `undefined` are now kept as-is, while properties that _do_ include `undefined` +are still made optional, but _only_ remove `undefined` from the property type whereas `NonNullable` also removed `null`s.