Skip to content

Conversation

@wesleyyee
Copy link
Contributor

@wesleyyee wesleyyee commented Feb 18, 2020

case 1: Default exported classes
When converting a class combined with a default export, to a pure component, you end up creating a syntax error. This is because you cannot combine the default keyword with a lexical declaration. This PR separates the declaration from the export in this case.

case 2: Unused super class import remains
When converting to a pure functional component the old super class may have a named import that is no longer used. This should be removed.

case 3: Props argument exists even if its never used

@wesleyyee wesleyyee force-pushed the wesleyy/pure-component-export branch from 01894e4 to f624984 Compare February 18, 2020 19:46
@wesleyyee wesleyyee force-pushed the wesleyy/pure-component-export branch from f624984 to d2fa36c Compare February 18, 2020 20:47
@wesleyyee wesleyyee changed the title Fix pure component transform for default exported classes Fix pure component transform edge cases Feb 18, 2020
@wesleyyee wesleyyee force-pushed the wesleyy/pure-component-export branch from 53e33f5 to a954ecd Compare February 18, 2020 22:00
@wesleyyee wesleyyee force-pushed the wesleyy/pure-component-export branch from a954ecd to b04dbaa Compare February 18, 2020 22:02
@wesleyyee wesleyyee force-pushed the wesleyy/pure-component-export branch from 881eb03 to 25b8d6f Compare February 19, 2020 18:25
@wesleyyee
Copy link
Contributor Author

@threepointone @bvaughn any thoughts?

@threepointone
Copy link
Contributor

At a glance it seems reasonable. Thank you for the PR! I'll do a proper review soon.

@threepointone
Copy link
Contributor

Thank you for your PR!

@threepointone threepointone merged commit 1f04dd8 into reactjs:master Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants