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 c26095d
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/gating.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,53 +4,53 @@ title: gating
4
4
5
5
<Intro>
6
6
7
-
Validates configuration of [gating mode](/reference/react-compiler/gating).
7
+
Valida a configuração do [modo de gating](/reference/react-compiler/gating).
8
8
9
9
</Intro>
10
10
11
-
## Rule Details {/*rule-details*/}
11
+
## Detalhes da Regra {/*rule-details*/}
12
12
13
-
Gating mode lets you gradually adopt React Compiler by marking specific components for optimization. This rule ensures your gating configuration is valid so the compiler knows which components to process.
13
+
O modo de gating permite adotar o React Compiler gradualmente, marcando componentes específicos para otimização. Esta regra garante que sua configuração de gating seja válida para que o compilador saiba quais componentes processar.
14
14
15
-
### Invalid {/*invalid*/}
15
+
### Inválido {/*invalid*/}
16
16
17
-
Examples of incorrect code for this rule:
17
+
Exemplos de código incorreto para esta regra:
18
18
19
19
```js
20
-
// ❌ Missing required fields
20
+
// ❌ Campos obrigatórios ausentes
21
21
module.exports= {
22
22
plugins: [
23
23
['babel-plugin-react-compiler', {
24
24
gating: {
25
25
importSpecifierName:'__experimental_useCompiler'
26
-
//Missing 'source' field
26
+
//Campo 'source' ausente
27
27
}
28
28
}]
29
29
]
30
30
};
31
31
32
-
// ❌ Invalid gating type
32
+
// ❌ Tipo de gating inválido
33
33
module.exports= {
34
34
plugins: [
35
35
['babel-plugin-react-compiler', {
36
-
gating:'__experimental_useCompiler'//Should be object
36
+
gating:'__experimental_useCompiler'//Deveria ser um objeto
37
37
}]
38
38
]
39
39
};
40
40
```
41
41
42
-
### Valid {/*valid*/}
42
+
### Válido {/*valid*/}
43
43
44
-
Examples of correct code for this rule:
44
+
Exemplos de código correto para esta regra:
45
45
46
46
```js
47
-
// ✅ Complete gating configuration
47
+
// ✅ Configuração de gating completa
48
48
module.exports= {
49
49
plugins: [
50
50
['babel-plugin-react-compiler', {
51
51
gating: {
52
-
importSpecifierName:'isCompilerEnabled', //exported function name
53
-
source:'featureFlags'//module name
52
+
importSpecifierName:'isCompilerEnabled', //nome da função exportada
53
+
source:'featureFlags'//nome do módulo
54
54
}
55
55
}]
56
56
]
@@ -61,11 +61,11 @@ export function isCompilerEnabled() {
61
61
// ...
62
62
}
63
63
64
-
// ✅ No gating (compile everything)
64
+
// ✅ Sem gating (compila tudo)
65
65
module.exports= {
66
66
plugins: [
67
67
['babel-plugin-react-compiler', {
68
-
//No gating field - compiles all components
68
+
//Sem o campo gating - compila todos os componentes
0 commit comments