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.

JSFiddle

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 20 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@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