extract-component

Provides an Extract Component refactoring task. Takes a selected JSX snippet and extracts it into a new component.

bspaulding

145

0

1.0.1

MIT

GitHub

extract-component package

Refactoring task to extract a portion of JSX as a new component.

TODO

x Prettier indentation on both removed and inserted text / Look for var refs and transform to props - done-ish, currently looks only for MemberExpression names would be better if became:

		const Component = ({ src }) => (
		<Image src={src}/>
	  )

	although this would introduce complexity and probably new edge cases