Skip to content

Commit 8353f1f

Browse files
committed
prettier
1 parent 723daa9 commit 8353f1f

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

compiler/apps/playground/components/TabbedWindow.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ function TabbedWindowItem({
7878
title="Minimize tab"
7979
aria-label="Minimize tab"
8080
onClick={toggleTabs}
81-
className={`p-4 duration-150 ease-in border-b cursor-pointer border-grey-200 ${
82-
hasChanged ? "font-bold" : "font-light"
83-
} text-secondary hover:text-link`}
81+
className={`p-4 duration-150 ease-in border-b cursor-pointer border-grey-200 ${hasChanged ? "font-bold" : "font-light"} text-secondary hover:text-link`}
8482
>
8583
- {name}
8684
</h2>
@@ -93,9 +91,7 @@ function TabbedWindowItem({
9391
aria-label={`Expand compiler tab: ${name}`}
9492
style={{ transform: "rotate(90deg) translate(-50%)" }}
9593
onClick={toggleTabs}
96-
className={`flex-grow-0 w-5 transition-colors duration-150 ease-in ${
97-
hasChanged ? "font-bold" : "font-light"
98-
} text-secondary hover:text-link`}
94+
className={`flex-grow-0 w-5 transition-colors duration-150 ease-in ${hasChanged ? "font-bold" : "font-light"} text-secondary hover:text-link`}
9995
>
10096
{name}
10197
</button>

compiler/packages/babel-plugin-react-compiler/src/Inference/InferReferenceEffects.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,9 +2117,9 @@ function getWriteErrorReason(abstractValue: AbstractValue): string {
21172117
return "Mutating component props or hook arguments is not allowed. Consider using a local variable instead";
21182118
} else if (abstractValue.reason.has(ValueReason.State)) {
21192119
return "Mutating a value returned from 'useState()', which should not be mutated. Use the setter function to update instead";
2120-
} else if(abstractValue.reason.has(ValueReason.ReducerState)){
2120+
} else if (abstractValue.reason.has(ValueReason.ReducerState)) {
21212121
return "Mutating a value returned from 'useReducer()', which should not be mutated. Use the dispatch function to update instead";
2122-
} {
2122+
} else {
21232123
return "This mutates a variable that React considers immutable";
21242124
}
21252125
}

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.modify-useReducer-state.expect.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { useReducer } from "react";
66

77
function Foo() {
8-
let [state, setState] = useReducer({foo:1});
8+
let [state, setState] = useReducer({ foo: 1 });
99
state.foo = 1;
1010
return state;
1111
}
@@ -17,7 +17,7 @@ function Foo() {
1717

1818
```
1919
3 | function Foo() {
20-
4 | let [state, setState] = useReducer({foo:1});
20+
4 | let [state, setState] = useReducer({ foo: 1 });
2121
> 5 | state.foo = 1;
2222
| ^^^^^ InvalidReact: Mutating a value returned from 'useReducer()', which should not be mutated. Use the dispatch function to update instead (5:5)
2323
6 | return state;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useReducer } from "react";
22

33
function Foo() {
4-
let [state, setState] = useReducer({foo:1});
4+
let [state, setState] = useReducer({ foo: 1 });
55
state.foo = 1;
66
return state;
77
}

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useReducer-returned-dispatcher-is-non-reactive.expect.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function f() {
99

1010
const onClick = () => {
1111
dispatch();
12-
}
12+
};
1313

1414
return <div onClick={onClick} />;
1515
}
@@ -52,6 +52,6 @@ export const FIXTURE_ENTRYPOINT = {
5252
};
5353

5454
```
55-
55+
5656
### Eval output
57-
(kind: ok) <div></div>
57+
(kind: ok) <div></div>

0 commit comments

Comments
 (0)