I migrating my widget to use TS and Webpack and React and im having an issue that results in the following TS error
‘Text’ cannot be used as a JSX component.
Its return type ‘FigmaDeclarativeNode’ is not a valid JSX element.
Type ‘undefined’ is not assignable to type ‘Element | null’.ts(2786)
I got same issue when I imported React from ‘react’, before that it was fine. Turns out that as soon as you try importing react for any reason (I needed useEffect), TS gets confused about types because it starts using normal React types.