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

Property 'plugins' does not exist on type 'IntrinsicAttributes & GrapesjsReactProps & { children?: ReactNode; } #58

Open
bostondevin opened this issue Feb 25, 2022 · 5 comments

Comments

@bostondevin
Copy link

bostondevin commented Feb 25, 2022

Any idea what this would be about?

ERROR in libs/grapes/src/lib/grapes.tsx:13:7
TS2322: Type '{ id: string; plugins: string[]; }' is not assignable to type 'IntrinsicAttributes & GrapesjsReactProps & { children?: ReactNode; }'.
Property 'plugins' does not exist on type 'IntrinsicAttributes & GrapesjsReactProps & { children?: ReactNode; }'.
11 | <GrapesjsReact
12 | id='grapesjs-react'

13 | plugins={[
| ^^^^^^^
14 | 'gjs-preset-webpage',
15 | 'gjs-blocks-basic'
16 | ]}

Here's the code - it works fine if I remove the plugins attribute:


import 'grapesjs-preset-webpage';
import { GrapesjsReact } from 'grapesjs-react';
export interface GrapesProps { }

export function Grapes(props: GrapesProps) {
  return (
    <GrapesjsReact
      id='grapesjs-react'
      plugins={[
        'gjs-preset-webpage',
        'gjs-blocks-basic'
      ]}
    />
  );
}

export default Grapes;

@bostondevin
Copy link
Author

bostondevin commented Feb 25, 2022

It seems like there is no way now to add plugins?

@thanhtunguet
Copy link
Owner

It might be the type declaration bug only. The code should work.
If it does not work, please include the runtime error trace.
Thank you

@vinicius-actcon
Copy link

It's probably because you are using this code with typescript and this prop is not defined in the type definition, so the react/typescript is not allowing your conde ran.

@abdellatifLabr
Copy link

For anyone who is using typescript, just add // @ts-ignore above plugins prop, should be fine for moving on until this issue is handled.

@junraemon
Copy link

junraemon commented Dec 1, 2022

Found a way to resolve this, by doing this:

`
import "grapesjs/dist/css/grapes.min.css"
import { GrapesjsReact } from "grapesjs-react"
import blocks from "grapesjs-blocks-basic"
import webpage from "grapesjs-preset-webpage"

function PageCanvas() {
return (
<GrapesjsReact
id="grapesjs-react"
plugins={[blocks, webpage]}
/>
)
}

export default PageCanvas
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants