Skip to content

Conversation

jsnmoon
Copy link
Contributor

@jsnmoon jsnmoon commented Apr 19, 2017

Howdy!

This change adds support for when getInitialState is defined with arrow functions. I've also added the corresponding test cases.

Please let me know if I missed anything!

Supported cases:

// ArrowFunctionExpression with BlockStatement body React.createClass({ getInitialState: (): {heyoo: number} => { return { heyoo: 23, }; }, }); // ArrowFunctionExpression with ObjectExpression body React.createClass({ getInitialState: (): {heyoo: number} => ({ heyoo: 23, }), });
@bvaughn bvaughn merged commit 60458ef into reactjs:master Jul 28, 2017
@jsnmoon jsnmoon deleted the add/get-initial-state-arrow-fns branch July 29, 2019 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants