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

Basic usage failing #30

Closed
msimonc opened this issue Jan 18, 2016 · 6 comments
Closed

Basic usage failing #30

msimonc opened this issue Jan 18, 2016 · 6 comments

Comments

@msimonc
Copy link

msimonc commented Jan 18, 2016

Thanks for this project!

When I wrap a tag in an otherwise working render() function:

import { Collapse } from 'react-collapse';
...
return (
                <Collapse isOpened={true}>
                    <h3>Cars</h3>
                </Collapse>
            );

I get:
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).

Dependencies installed, Babel 6 / ES6, webpack build...

@nkbt
Copy link
Owner

nkbt commented Jan 19, 2016

import Collapse from 'react-collapse';

react-collapse exports only one component.

@nkbt nkbt closed this as completed Jan 19, 2016
@msimonc
Copy link
Author

msimonc commented Jan 19, 2016

Thanks, but I now get:

Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

@nkbt
Copy link
Owner

nkbt commented Jan 19, 2016

Are you adding ref anywhere? To <Collapse> for example? That would not work I believe.

Can you clone http://codepen.io/nkbt/pen/MarzEg?editors=101 and put your example there to reproduce the issue?

@nkbt nkbt added the question label Jan 19, 2016
@calvinfroedge
Copy link

I am also having this error with latest version of react. Using as follows:

<Collapse isOpened={this.state.expanded}>{this.props.children}</Collapse>

@nkbt
Copy link
Owner

nkbt commented Feb 25, 2016

@calvinfroedge which version of React you are using?
http://codepen.io/nkbt/pen/MarzEg?editors=101 -- this demo works pretty well with react@0.14.6

20160225-164743

@nkbt nkbt reopened this Feb 25, 2016
@nkbt
Copy link
Owner

nkbt commented Aug 11, 2016

I reckon I can close this now...

@nkbt nkbt closed this as completed Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants