You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f47d0e9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/reference/eslint-plugin-react-hooks/lints/unsupported-syntax.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@ title: unsupported-syntax
4
4
5
5
<Intro>
6
6
7
-
Validates against syntax that React Compiler does not support. If you need to, you can still use this syntax outside of React, such as in a standalone utility function.
React Compiler needs to statically analyze your code to apply optimizations. Features like `eval`and`with`make it impossible to statically understand what the code does at compile time, so the compiler can't optimize components that use them.
@@ -37,9 +37,9 @@ function Component({propName}) {
37
37
}
38
38
```
39
39
40
-
### Valid {/*valid*/}
40
+
### 有効な例 {/*valid*/}
41
41
42
-
Examples of correct code for this rule:
42
+
このルールに従ったコードの例です。
43
43
44
44
```js
45
45
// ✅ Use normal property access
@@ -54,11 +54,11 @@ function Component() {
54
54
}
55
55
```
56
56
57
-
## Troubleshooting {/*troubleshooting*/}
57
+
## トラブルシューティング {/*troubleshooting*/}
58
58
59
-
### I need to evaluate dynamic code {/*evaluate-dynamic-code*/}
59
+
### 動的なコードを評価したい {/*evaluate-dynamic-code*/}
60
60
61
-
You might need to evaluate user-provided code:
61
+
以下のように、ユーザが入力したコードを評価する必要があるかもしれません。
62
62
63
63
```js {expectedErrors: {'react-compiler': [3]}}
64
64
// ❌ Wrong: eval in component
@@ -68,7 +68,7 @@ function Calculator({expression}) {
68
68
}
69
69
```
70
70
71
-
Use a safe expression parser instead:
71
+
代わりに、安全な式のパーサを使ってください。
72
72
73
73
```js
74
74
// ✅ Better: Use a safe parser
@@ -97,6 +97,6 @@ function Calculator({expression}) {
97
97
98
98
<Note>
99
99
100
-
Never use `eval`with user input - it's a security risk. Use dedicated parsing libraries for specific use cases like mathematical expressions, JSON parsing, or template evaluation.
0 commit comments