Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Passing custom class as component #36

Closed
asvetliakov opened this issue Feb 25, 2016 · 2 comments
Closed

Passing custom class as component #36

asvetliakov opened this issue Feb 25, 2016 · 2 comments

Comments

@asvetliakov
Copy link
Contributor

Has passing only html tags as strings and {false} to component prop of Transition been intended?

I'm trying to do something like:

class Menu extends React.Component {...}

class AnimatedMenu extends React.Component {
  render() {
    return (
      <Transition component={Menu} ...>...</Transition>
    );
  }
}

This works but gives me warning about incorrect prop types

@souporserious
Copy link
Owner

Hmm interesting, no it wasn't intended. I did not realize you could pass a custom component like that. Totally makes sense though. If you'd like to do a PR, I can review it and bring it in if all looks good. Should be just a PropType update correct?

@asvetliakov
Copy link
Contributor Author

Yes should be just PropType update, however not sure if just React.PropTypes.element element will work or need a custom validator with checking for React.isValidElement().
I'll give a try

asvetliakov added a commit to asvetliakov/react-motion-ui-pack that referenced this issue Feb 25, 2016
asvetliakov added a commit to asvetliakov/react-motion-ui-pack that referenced this issue Mar 1, 2016
souporserious added a commit that referenced this issue Mar 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants