We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strict Typescript yells that types Config and Config<Props> are not compatible.
Config
Config<Props>
Here are my types:
type PuckProps = { Typography: PropsFrom<typeof Typography> Spoiler: PropsFrom<typeof Spoiler> Link: PropsFrom<typeof Link> Image: PropsFrom<typeof Image> Video: PropsFrom<typeof Video> Audio: PropsFrom<typeof Audio> Divider: PropsFrom<typeof Divider> List: PropsFrom<typeof List> CopyText: PropsFrom<typeof CopyText> AskLLM: PropsFrom<typeof AskLLM> Code: PropsFrom<typeof Code> }
I use them like this:
const config = { ... } satisfies Config<PuckProps>
Allow passing props to React components (same as you allow for Config type).
declare function Render<Props>({ config, data }: { config: Config<Props>; data: Data; }): react_jsx_runtime.JSX.Element;
The text was updated successfully, but these errors were encountered:
@BleedingDev what do you mean by "won't work everywhere"?
We'd have to add that kind of type definition for each component in Puck, which It think is acceptable.
Sorry, something went wrong.
I did a manual edit in my node_modules, that's why it won't work. But I checked that it fixes the problem.
node_modules
fix: enable user to pass in config without casting
82ed63a
Closes #185
ee211e2
@BleedingDev I believe this should be fixed in 0.13.0-canary.b95050d!
0.13.0-canary.b95050d
chrisvxd
Successfully merging a pull request may close this issue.
Problem
Strict Typescript yells that types
Config
andConfig<Props>
are not compatible.Here are my types:
I use them like this:
Solution
Allow passing props to React components (same as you allow for Config type).
My suggested solution (fixed locally, but won't work everywhere)
The text was updated successfully, but these errors were encountered: