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.

Cannot render component through higher order component

See original GitHub issue

Bug Report

Cannot render component through higher order component

while exporting a component directly works fine, if a component is exported via a higher order component then the PropType table does not render

To Reproduce

  1. set PropType (e.g. SubTitle.propTypes = { error: PropTypes.bool })
  2. export component as via higher order component (e.g. export default HOC(SubTitle))
  3. PropType table does not appear
// basic HOC() for demonstration
import React from 'react'
export default (HOC) => {
  return class ReactHOC extends React.Component {
    render() {
      return <HOC {...this.props}/>
    }
  }
}

Enviroment

  • OS: OSX 10.13.3
  • Node: v8.9.4
  • NPM: v6.0.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
diegohazcommented, Jul 7, 2018

It doesn’t. Unless there’s something that transforms flow/typescript into PropTypes.

0reactions
pedronauckcommented, Sep 11, 2018

I’ll close this since it will be also fixed with #240 when we can pass custom config to react docgen

Read more comments on GitHub >

github_iconTop Results From Across the Web

Higher-Order Components - React
A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per...
Read more >
React higher-order component - Warning: Cannot update a ...
I am using a fully immutable Redux store and do not use any non-functional components. I am afraid that because I am getting...
Read more >
Introduction to Higher-Order Components in React by example
We use higher order components to primarily reuse logic in React apps. However, they have to render some UI. Hence, HOCs are inconvenient...
Read more >
Understanding React higher-order components
A higher-order component is a function that takes in a component and returns a new component. Using code, we can rewrite the above...
Read more >
Higher-Order Components in React js - Topcoder
React provides us with a technique to reuse component logic. This is an advanced technique called higher-order component, or HOC.
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