You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should support wrapping stateless functional components (see here).
This shouldn't be too hard. Our decorator should check if the thing its wrapping has extended React.Component. If it has, do as we already do. If it hasn't (and is a function) then we make a class that extends React.Component that will essentially look something like
I'd imagine that (unless I'm missing something here) lots of people are going to be implementing this same functionality, which detects if a component extends React.Component or is a stateless functional component, and then converts to a class extending React.Component if it is stateless. So maybe that part of the solution should be separated into a standalone npm package.
We should support wrapping stateless functional components (see here).
This shouldn't be too hard. Our decorator should check if the thing its wrapping has extended
React.Component
. If it has, do as we already do. If it hasn't (and is a function) then we make a class that extendsReact.Component
that will essentially look something likeand then use this
WrappedComponent
like we already do.The text was updated successfully, but these errors were encountered: