Fix pure component transform edge cases #255
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
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