Open andrew-pledge-io opened 2 weeks ago
Given a figma connect configuration where figma.boolean is returning a function in one branch, e.g.:
figma.boolean
import figma from '@figma/code-connect'; import { MyComponent } from './MyComponent.js'; figma.connect(MyComponent, 'https://www.figma.com/', { props: { render: figma.boolean('has a render prop', { true: (props: any) => <span {...props}>a render prop</span>, false: undefined, }), }, example: (props) => <MyComponent render={props.render} />, });
The type of props.render is {} which results in a type error:
props.render
{}
Type '{}' is not assignable to type '(props: unknown) => ReactNode'. Type '{}' provides no match for the signature '(props: unknown): ReactNode'.
In 1.1.4 the type was correctly inferred so this seems to be a regression.
Hey @andrew-pledge-io, thanks for the report. Sounds like a bug. We'll look into this and update you!
Given a figma connect configuration where
figma.boolean
is returning a function in one branch, e.g.:The type of
props.render
is{}
which results in a type error:In 1.1.4 the type was correctly inferred so this seems to be a regression.