grapesjs-react
React wrapper for GrapesJS
grapesjs-react
v3 was fully rewritten from scratch. The package is now only responsible to expose hooks and control the editor lifecycle for these reasons:
- This package depends on
artf/grapesjs
, which does not support Typescript. It is hard to implement custom features Components, Blocks without declaration files. - To be simple, this package should only control the lifecycle of the editor, leave the rest to the dependent projects.
Install
yarn add gs-react// ornpm i gs-react --save
New editor props:
Default props of the editor:
Editor.defaultProps =;
Introduce new hooks:
onInit
: Called after editor initializing, used for adding custom components, blocks, etc, ...onDestroy
: Called before editor unmounting, used for cleaning up.
Import CSS:
;
See storybook demo: https://grapesjs-react.thanhtunguet.info