Thanks, I was blowing my mind trying to figure that.
Could you share a bit more context on how you got this working with Typescript?Component.layout is throwing "unsafe assignment of an any value".
import * as React from "react"; import { NextPage } from "next"; type Page = NextPage & { Layout?: React.FC }; const MyPageComponent: Page = () => { return null; } export default MyPageComponent;
type Page = NextPage & { layout?: (props: { children: ReactNode }) => JSX.Element }
This seems to have done the trick for me when not using fat-arrow functions.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks, I was blowing my mind trying to figure that.
Could you share a bit more context on how you got this working with Typescript?Component.layout is throwing "unsafe assignment of an any value".
This seems to have done the trick for me when not using fat-arrow functions.