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

Errors when trying to use inside React JSX #11

Open
dmitriz opened this issue May 7, 2017 · 3 comments
Open

Errors when trying to use inside React JSX #11

dmitriz opened this issue May 7, 2017 · 3 comments

Comments

@dmitriz
Copy link

dmitriz commented May 7, 2017

Steps to reproduce:

$ create-react-app my-app

then copy the React example inside the App.js file,
uncomment ReactDOM.render(<Button />, mountNode),
instead trying to put <Button /> directly inside the JSX.

Complained about undefined html, so I had added this line:

var html = require('bel')

The error changed to

assert.js:59Uncaught AssertionError: nanocomponent-adapters/react: component should be type function

in the console and the screen is empty.

@dmitriz
Copy link
Author

dmitriz commented May 7, 2017

I have found and removed these assertions that somehow were in the package, perhaps by mistake:

https://github.com/yoshuawuyts/nanocomponent-adapters/blob/master/react.js#L6-L7

Now there is real error though:

warning.js:36Warning: A Component: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.printWarning @ warning.js:36warning @ warning.js:60ReactClass.createClass @ ReactClass.js:628toReact @ react.js:11(anonymous function) @ App.js:19__webpack_require__ @ bootstrap d183399…:555fn @ bootstrap d183399…:86(anonymous function) @ index.js:3__webpack_require__ @ bootstrap d183399…:555fn @ bootstrap d183399…:86(anonymous function) @ bootstrap d183399…:578__webpack_require__ @ bootstrap d183399…:555(anonymous function) @ bootstrap d183399…:578(anonymous function) @ bootstrap d183399…:578

react.js:21Uncaught TypeError: component is not a function

The screen elements are back, but not the button.

@yoshuawuyts
Copy link
Member

yoshuawuyts commented May 18, 2017 via email

@toddself
Copy link

We could also use the create-class shim...

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