babel-plugin-jsx-adopt icon indicating copy to clipboard operation
babel-plugin-jsx-adopt copied to clipboard

Fix ArrowFunctionExpression with body being an expression

Open Andarist opened this issue 7 years ago • 0 comments

const example = () => (theme = <ThemeContext.Consumer />)

this is likely broken because of https://github.com/Andarist/babel-plugin-jsx-adopt/blob/c76850888c7fa4d4f04eb8b178f9ff2fa8f418c5/src/index.js#L143

stmt will be found in outer function (the one containing example), logic should be contained to the nearest function only, which in this care is the whats inside example

Andarist avatar Mar 18 '18 15:03 Andarist