Doesn't work with decorator
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
I have the following code:
```
import React, { Component, PropTypes } from 'react';
import LinkedStateMixin from 'react-addons-linked-state-mixin';
import ReactMixin from 'react-mixin';
import s from './LoginPage.scss';
import withStyles from '../../decorators/withStyles';
const title = 'Log In';
@withStyles(s)
class LoginPage extends Component {
constructor() {
super();
this.state = {
user: '',
password: ''
}
}
static contextTypes = {
onSetTitle: PropTypes.func.isRequired,
};
componentWillMount() {
this.context.onSetTitle(title);
}
login(e) {
e.preventDefault();
console.log(e)
}
render() {
return (
{title}
Password
Login
Forgot your password?
);
}
}
ReactMixin(LoginPage.prototype, LinkedStateMixin);
export default LoginPage
```
The react-mixin functionality works as intended without a decorator, however, when a decorator is included I get the error "this.linkState is not a function'
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the supplied LoginPage example, then inspect the withStyles decorator and the ReactMixin(LoginPage.prototype, LinkedStateMixin) call. Compare the decorated and undecorated cases to determine why linkState is missing; done when the decorator no longer prevents the mixin method from working and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100