21 lines
307 B
Markdown
21 lines
307 B
Markdown
#### Fix optional chaining as computed key (#17486 by @fisker)
|
|
|
|
<!-- prettier-ignore -->
|
|
```jsx
|
|
// Input
|
|
const a = { [y?.z]() {} };
|
|
class A { [y?.z]() {} };
|
|
|
|
// Prettier stable
|
|
const a = { [y?.z]?() {} };
|
|
class A {
|
|
[y?.z]?() {}
|
|
}
|
|
|
|
// Prettier main
|
|
const a = { [y?.z]() {} };
|
|
class A {
|
|
[y?.z]() {}
|
|
}
|
|
```
|