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.

Display components wrapped in Higher-Order components

See original GitHub issue

Hey,

I applied the Higher-Order Component (HOC) design-pattern (concept for react explained here) like this: https://github.com/vuejs/vue/issues/6201#issuecomment-318009211

A component that makes use of such a HOC is no longer displayed by vue-styleguidist.

I suppose that vue-styleguidist needs a component to return an Object of the structure seen in the screenshot. A HOC of course returns a function instead, as seen in that screenshot as well.

vue-styleguidist-hoc

Is it possible to implement that feature? Thanks

Also, if possible, respect /** */ inline documentations defined in HOC’s.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
elevatebartcommented, Oct 28, 2019

Hey @hollandThomas I will close this issue for now as I feel like Vue 3 is going to make it completely obsolete. Fell free to re-open it if you make a use case.

0reactions
elevatebartcommented, Oct 18, 2018

Hey @hollandThomas , great suggestion.

For now most of what vue-styleguidist is doing is displaying whatever vue-docgen-api returns. This module only parses components. We could create a plugin for this api for it to parse the HOC pattern.

If you can cook up a little test to showcase the pattern then we would add it as a test/example to the main repo and could start working on a solution to make it work. I am not familiar with the issue it solves.

Thank you in advance

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 ... The most common technique is to wrap the display name of...
Read more >
Higher-Order Components In React - Smashing Magazine
A higher-order component (HOC) is an advanced element for reusing logic in React components. Components take one or more components as arguments ...
Read more >
Introduction to Higher-Order Components in React by example
React's Higher Order Component is a pattern that stems from React's nature that privileges composition over inheritance. Consider this example –
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 >
React Higher-Order Components (HOCs) - Robin Wieruch
Higher -Order Components in React, also known as HOCs, are an advanced component pattern in React (next to Render Props Components).
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