Add the possibility to set a custom root component tag#32
Add the possibility to set a custom root component tag#32branchard wants to merge 1 commit intojstejada:masterfrom
Conversation
jstejada
left a comment
There was a problem hiding this comment.
This is awesome, thanks so much for adding this! Just added a couple of small comments that we should address before landing, but otherwise LGTM.
Thanks again, and I'm really sorry for the delay!
| ```xml | ||
| <span class="Typist"> Animate this text. </span> | ||
| ``` | ||
|
|
|
|
||
| static propTypes = { | ||
| children: PropTypes.node, | ||
| component: PropTypes.oneOfType([PropTypes.element, PropTypes.string]), |
There was a problem hiding this comment.
this should be oneOfType([PropTypes.func, PropTypes.string]), if we actually want to allow component classes.
However, I'm thinking that for simplicity's sake, we should just take a string without allowing component classes at all. I thing just specifying a dom tag should be sufficient for most use cases.
| return ( | ||
| <div className="TypistExample"> | ||
| <Typist | ||
| component="div" |
There was a problem hiding this comment.
nit: do we really need this here?
| var isDone = this.state.isDone; | ||
|
|
||
| var innerTree = utils.extractTreeWithText(this.props.children, this.state.text); | ||
| var WrapComponent = this.props.component; |
There was a problem hiding this comment.
would you mind removing this generated code from the PR? I'll make sure to generate a new dist when I cut a new version.
|
@branchard, just a friendly ping :) I think you need to pull latest from master -- |
will produce: