Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

react complains props is not a plain object #14

Description

@nippur72

I have the following react code running in node.js:

let fn = _eval(
`
      var React = require("react");
      module.exports = function(props,el) {
         return React.createElement("div",{},"hello");
      }
`
, "eval", {}, true);
let component = React.createElement(fn, { name: "John" });           
let s = ReactDOMServer.renderToString(component);
console.log(s);

but react complains that

Warning: React.createElement(...): Expected props argument to be a plain object. Properties defined in its prototype chain will be ignored.

Does anybody knows why this is happening and is there something I can do?

Of course there is no warning if I execute outside of _eval. I should mention also that the above warning was introduced with react/react#6134

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions