You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtype{LayoutComponent}from'@remix-run/react/dist/routeModules'exportconstLayout: LayoutComponent=functionLayout({ children }){return<div/>}// Property 'children' does not exist on type '{}'.ts(2339)
We can get this updated internally but FWIW route module component types are not exported through the top-level @remix-run/react because they're not currently public API. I think there's some hope eventually TS will be able to type at the module level at which point Remix would be able to provide better type safety on module exports, but until then we haven't made the decision to export those types for RouteComponent, ErrorBoundaryComponent, HydrateFallbackComponent, or LayoutComponent.
Reproduction
root.tsx
System Info
Used Package Manager
pnpm
Expected Behavior
to follow the docs on the root layout export.
Actual Behavior
Type is
ComponentType
, akaComponentType<{}>
; a user-defined component that takes no props.The text was updated successfully, but these errors were encountered: