react-email-editor icon indicating copy to clipboard operation
react-email-editor copied to clipboard

unlayer not defined or Cannot read property 'registerTool' of undefined

Open ghost opened this issue 4 years ago • 3 comments

image

ghost avatar Feb 23 '21 11:02 ghost

@manjuadoor registerTool is only avaiable inside customJS. You can check the notice on top here: https://docs.unlayer.com/docs/create-custom-tool

adeelraza avatar Feb 24 '21 21:02 adeelraza

@manjuadoor

Then how to use custom JS in ReactJS from the local project (made in NextJS)?

getpiyushfar avatar Aug 13 '21 06:08 getpiyushfar

@getpiyushfar You need to compile and serve your .jsx as .js at a public path (you can use the entry config if you're using Webpack) and pass that path to Unlayer. From inside that file, you can call window.unlayer.registerPropertyEditor. As Adeel said, it's only available inside this context.

faizan-ali avatar Sep 08 '21 22:09 faizan-ali