Skip to content
New issue

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

Type error when try to use plugin/react-editor #207

Closed
insanicly opened this issue Nov 26, 2023 · 2 comments
Closed

Type error when try to use plugin/react-editor #207

insanicly opened this issue Nov 26, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@insanicly
Copy link

Hi everyone,
thank you for providing this amazing tool. I having problems working with it.

When I simply try to follow the quick start from the given link from the read me, it simply fails.

Here are my steps:

npx --yes create-figma-plugin (select plugin/react-editor from the options)
cd react-editor/
npm run watch

it fails with this error:

success Built in 0.124s
info Typechecking...
error TypeScript error

src/ui.tsx:30:10 - error TS2786: 'Editor' cannot be used as a JSX component.
  Its type 'typeof Editor' is not a valid JSX element type.
    Type 'typeof Editor' is not assignable to type 'ComponentClass<any, {}>'.
      Types of property 'contextType' are incompatible.
        Type 'import("/Users/alper/My-projects/react-editor/node_modules/@types/react/index").Context<any> | undefined' is not assignable to type 'preact.Context<any> | undefined'.
          Type 'import("/Users/alper/My-projects/react-editor/node_modules/@types/react/index").Context<any>' is not assignable to type 'preact.Context<any>'.
            Types of property 'Consumer' are incompatible.
              Type 'import("/Users/alper/My-projects/react-editor/node_modules/@types/react/index").Consumer<any>' is not assignable to type 'preact.Consumer<any>'.
                Types of parameters 'props' and 'props' are incompatible.
                  Type 'RenderableProps<{ children: (value: any) => ComponentChildren; }, any>' is not assignable to type 'ConsumerProps<any>'.
                    Types of property 'children' are incompatible.
                      Type '((value: any) => ComponentChildren) & ComponentChildren' is not assignable to type '(value: any) => ReactNode'.
                        Type '((value: any) => ComponentChildren) & string' is not assignable to type '(value: any) => ReactNode'.
                          Type 'ComponentChildren' is not assignable to type 'ReactNode'.
                            Type 'bigint' is not assignable to type 'ReactNode'.

30         <Editor
            ~~~~~~

success Typechecked in 1.195s

What can be done to overcome this error?

thank you for your help in advance.

@morphine-cake
Copy link

Did you find any workaround for this one?

@yuanqing yuanqing added the bug Something isn't working label Dec 9, 2023
@yuanqing
Copy link
Owner

yuanqing commented Dec 9, 2023

Fixed in 3.1.0

$ npx --yes -- create-figma-plugin@3.1.0 --template plugin/react-editor

@yuanqing yuanqing closed this as completed Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants