question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PropsTable is not working with components created using createElement()

See original GitHub issue

Bug Report

PropTypes defined on Components using createElement() are not presented in PropsTable.

I used some time trying to create example using project examples but then i received a new error related to this: https://github.com/pedronauck/docz/issues/339

Component:

const Button = ({
  as, children, ...other
}) => createElement(
  as || 'button',
  {
    type: 'button',
    ...other,
  },
  <div>{children}</div>,
);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

9reactions
ozzyogkushcommented, Oct 11, 2018

FWIW I’m unable to get the PropsTable to work with simple functional and class components as well.

4reactions
JackCuthbertcommented, Dec 13, 2018

@kamalgill, @jamesg1, @ozzyogkush, using TS I managed to work around this by using import * as React from 'react' instead of import React from 'react' in my components. The latter doesn’t seem to be able to produce a PropsTable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are React components executed through the ` ...
it doesn't work. Meanwhile, in the React documentation it is called like this: React.createElement(Component([props]) ...
Read more >
Document.createElement() - Web APIs | MDN
createElement() method creates the HTML element specified by tagName, or an HTMLUnknownElement if tagName isn't recognized. Syntax.
Read more >
API Reference - Roact Documentation
A component that represents a portal to a Roblox Instance. Portals are created using Roact.createElement . Any children of a portal are put...
Read more >
Attempting to create custom component using document. ...
Attempting to create a web component directly (e.g., document.createElement("au-my-component") ) throws an error: Failed to construct ' ...
Read more >
React.createElement
However, JSX is NOT exactly the same as HTML, so you should learn React.createElement first. What is a React Element? In React, an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found