Repository navigation
Description
I am trying to use different UI toolkits and so far I haven't succeeded with any. Material-UI issue is already reported as #119, but React-MD raises another error, so I thought it should be reported separately.
Here is the pages/index.js:
import React from 'react'
import Head from 'next/head'
import { RaisedButton } from 'react-md/lib/Buttons'
export default class App extends React.Component {
handleClick() {
console.log("clicked!")
}
render() {
return <div>
<Head>
<link rel="stylesheet" href="https://npmcdn.com/react-md/dist/react-md.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
</Head>
<div>
<RaisedButton label="Hello, World!" onClick={this.handleClick} />
</div>
</div>
}
}Here are the npm dependencies:
$ npm install --save next react-md react-addons-transition-group react-addons-pure-render-mixin react-addons-css-transition-group
On page load I see the following warnings:
Warning: getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.
Warning: getInitialState was defined on ReactTransitionGroup, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?
The first warning points to this line: https://github.com/mlaursen/react-md/blob/bec6b087eb0a6af38f0a0613d25d8a17f6c7b0a6/src/js/Inks/injectInk.js#L243. However, I couldn't locate the real source of the second warning.
And here is what I get on a button click:
Uncaught Error: 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
Uncaught TypeError: Cannot read property 'componentWillLeave' of undefined
The line of code where the error occurs is inside React: https://github.com/facebook/react/blob/c78464f8ea9a5b00ec80252d20a71a1482210e57/src/addons/transitions/ReactTransitionGroup.js#L194
I do get clicked! logged, but the "bubble" animation doesn't work.
It seems that something magical happens and it feels like there are two Reacts are loaded somehow, so the ref keys are not registered.
Activity
frol commentedon Nov 5, 2016
I am closing this in favor of a more specific #204 bug report.