nanocomponent-adapters
nanocomponent-adapters copied to clipboard
Errors when trying to use inside React JSX
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.
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.
yeah we should probs switch to prototypes for this, and update to latest nanocomponent. haha
On Sun, May 7, 2017 at 10:32 AM Dmitri Zaitsev [email protected] wrote:
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…:578react.js:21Uncaught TypeError: component is not a function
The screen elements are back, but not the button.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/nanocomponent-adapters/issues/11#issuecomment-299690473, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlet86dDdFtRF9IajhVo3LEXe7mKYbks5r3YG2gaJpZM4NTDnQ .
We could also use the create-class shim...