inferno: Component is not a function
Error: Component is not a function (mountComponent, inferno-compat:1047)
Code:
const { render, Component } = Inferno;
class Tooltip extends Component {
static defaultProps = {
component: 'a'
};
render() {
const Component = this.props.component;
return <Component>{this.props.children}</Component>;
}
}
render(<Tooltip>Hi</Tooltip>, document.body);
Expected Current Behaviour
Should run, at least with inferno-compat; React.createElement('a') is valid syntax.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (16 by maintainers)
Commits related to this issue
- Add test for vars in jsx that resolve to strings (React compat) Ref: #513 — committed to STRML/inferno by STRML 8 years ago
@steadicat Sorry, we haven’t published a new version yet. The current version has been the same version for a while now. I’ll get a version out for you tonight 😃
beta33