PropsTable is not working with components created using createElement()
See original GitHub issueBug 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:
- Created 5 years ago
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW I’m unable to get the PropsTable to work with simple functional and class components as well.
@kamalgill, @jamesg1, @ozzyogkush, using TS I managed to work around this by using
import * as React from 'react'
instead ofimport React from 'react'
in my components. The latter doesn’t seem to be able to produce a PropsTable.