lemieux / react-messenger-plugin

React component wrapper for Facebook Messenger plugins.
MIT License
13 stars 11 forks source link

React.createElement: type is invalid #10

Closed HaswinVidanage closed 6 years ago

HaswinVidanage commented 7 years ago

I get the error as following .

React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

here's my code :

import React from 'react';
import './index.css';
var render = require("react-dom").render;

var MessengerPlugin = require("react-messenger-plugin");

render(
    <MessengerPlugin
      appId="xxxxx"
      pageId="xxxxx"
    />,
    document.getElementById('root')
);
lemieux commented 7 years ago

I think my example in the README is bad since I'm using ES6 packages in the code. Try doing var MessengerPlugin = require("react-messenger-plugin").default; instead.