Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inlining JSX removes curly braces #801

Closed
automatensalat opened this issue Jan 30, 2023 · 1 comment
Closed

Inlining JSX removes curly braces #801

automatensalat opened this issue Jan 30, 2023 · 1 comment
Labels
🐛 Bug Refactoring breaks existing behavior

Comments

@automatensalat
Copy link
Contributor

Describe the bug

When performing the Inline refactoring on a JSX element targeting a JSX prop, the refactoring omits the curly braces {} around the prop value, resulting invalid syntax:

function MyComponent() {
  const header = <span>hello</span>; // <-- inline this
  return <Menu header={header} />
}

// resulting in:
function MyComponent() {
  return <Menu header=<span>hello</span> />
}

How to reproduce

See above code

Expected behavior

It should retain the {} curly braces:

function MyComponent() {
  return <Menu header={<span>hello</span>} />
}

Additional information

  • Version of the extension impacted: v6.18.2

🧙‍ Add any other context about the problem here.

@automatensalat automatensalat added the 🐛 Bug Refactoring breaks existing behavior label Jan 30, 2023
@nicoespeon
Copy link
Owner

Thanks for the report. That should be fixed now! I'll cut a new release tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Refactoring breaks existing behavior
Projects
None yet
Development

No branches or pull requests

2 participants