We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Before:
let WorkspaceItemView = React.createClass({ displayName: 'WorkspaceItemView', getInitialState() { return { workspaceItemManager: this._getWorkspaceItemManager(this.props.id), workspaceItemStore: this._getWorkspaceItemStore(this.props.id) }; }, });
After: (that's how it works now)
class WorkspaceItemView extends React.Component { static displayName = 'WorkspaceItemView'; state = { workspaceItemManager: this._getWorkspaceItemManager(this.props.id), workspaceItemStore: this._getWorkspaceItemStore(this.props.id) }; }
But it should be this:
class WorkspaceItemView extends React.Component { static displayName = 'WorkspaceItemView'; constructor(props) { super(props); this.state = { workspaceItemManager: this._getWorkspaceItemManager(this.props.id), workspaceItemStore: this._getWorkspaceItemStore(this.props.id) }; } }
The text was updated successfully, but these errors were encountered:
No, this is intentional. The new codemod expects you to use the class properties transform.
cc @keyanzhang
Sorry, something went wrong.
Yeah, we don't need to create a constructor when the initial state is simple. The updated README explains how it works :)
for those who needed more information. #54 transform-class-properties
No branches or pull requests
Before:
After: (that's how it works now)
But it should be this:
The text was updated successfully, but these errors were encountered: