createElement is not defined ReferenceError: createElement is not defined

0
I am facing this error while creating an pluggable widget
asked
3 answers
6

Hi  Ajay Chimanpure
Make sure when you are implementing your Pluggable Widgets using React to import createElement from ‘react’
like this for an example : 

import { createElement } from "react";

this imported component will be used on your build process and make sure your environment is running smoothly.
npm run build
npm run start 
>>go to project in studio >> press F4 or Synchronize project directory => to update your widget and voila, happy hacking

answered
0

Thank you for the solution Seif Miehiar.

answered
0

This error occurs in Chrome Browser when you read a property or call a method on an undefined object . There are a few variations of this error depending on the property you are trying to access. Sometimes instead of undefined it will say null.

 

You can handle undefined by using if statement.

 

if (typeof(yourvariable) == 'undefined') {
  ...
}

 

 

answered