Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React.createElement: type should not be null, undefined, boolean, or number #173

Closed
chris-hinds opened this issue Sep 12, 2016 · 5 comments
Labels

Comments

@chris-hinds
Copy link

Hi, When importing and including this component on my page I receive the following errors:

React.createElement: type should not be null, undefined, boolean, or number

bundle.js:1 Error: Element type is invalid: expected a string (for built-in components) or a class/function

These error only appear when i an using the react-helmet component.

Here is my full component so far:

import Helmet from 'react-helmet';
import React from 'react';
import grandstand from 'grandstand';

export default class MyModule extends React.Component {
    constructor(props) {
        super(props);

        // initial state
    }

    componentWillMount() {
        grandstand(this.props.serviceName);
        console.log(Helmet);
    }

    render() {
        return (
            <div>
                <Helmet title="My Title"/>
                <h1>Welcome to the mobile web</h1>
            </div>
        )
    }
}

MyModule.displayName = 'MyModule';

MyModule.propTypes = {
    serviceName: React.PropTypes.string
};
@sjzamora86
Copy link

sjzamora86 commented Nov 25, 2016

I'm having same issue in unit test using Enzyme full rendering

@cwelch5
Copy link
Contributor

cwelch5 commented Dec 4, 2016

@hindsc52 This could be because you are console logging Helmet before the Helmet is mounted. If you remove the console do you still get the error?

@cwelch5
Copy link
Contributor

cwelch5 commented Dec 5, 2016

@hindsc52 @sjzamora86 I can't seem to reproduce with the console log. And can't reproduce in my unit tests, using Karma though.

Do either of you see this issue in another component with Helmet? Or any more detail you can add to your experience?

@chris-hinds
Copy link
Author

@cwelch5 Hi unfortunately i had stopped working on the project using this component so can no longer comment on the issue.

@potench
Copy link
Contributor

potench commented Dec 29, 2016

Closing this issue since this thread is cold. Issue may be related to #190, so if we need to re-open this issue please post what version of Helmet you're using as this is fixed in v3.2.2

@potench potench closed this as completed Dec 29, 2016
@potench potench added the bug label Dec 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants