mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[be] Remove unused validateRefAccessDuringRenderFunctionExpressions flag
I had split this up from the main validation since function validation was less precise; now that previous PRs fix the false positives we can remove this extra flag.
This commit is contained in:
@@ -172,14 +172,6 @@ const EnvironmentConfigSchema = z.object({
|
||||
// Validate that ref values (`ref.current`) are not accessed during render.
|
||||
validateRefAccessDuringRender: z.boolean().default(false),
|
||||
|
||||
/**
|
||||
* Extension of validateRefAccessDuringRender that validates that refs are not accessed during
|
||||
* render indirectly by calling function expressions which access the ref.
|
||||
*
|
||||
* This validation has known issues and is not yet recommended
|
||||
*/
|
||||
validateRefAccessDuringRenderFunctionExpressions: z.boolean().default(false),
|
||||
|
||||
/*
|
||||
* Validates that setState is not unconditionally called during render, as it can lead to
|
||||
* infinite loops.
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
// @validateRefAccessDuringRender @validateRefAccessDuringRenderFunctionExpressions
|
||||
// @validateRefAccessDuringRender
|
||||
function Component(props) {
|
||||
const ref = useRef(null);
|
||||
const renderItem = (item) => {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @validateRefAccessDuringRender @validateRefAccessDuringRenderFunctionExpressions
|
||||
// @validateRefAccessDuringRender
|
||||
function Component(props) {
|
||||
const ref = useRef(null);
|
||||
const renderItem = (item) => {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
// @validateRefAccessDuringRender @validateRefAccessDuringRenderFunctionExpressions
|
||||
// @validateRefAccessDuringRender
|
||||
function Component(props) {
|
||||
const ref = useRef(null);
|
||||
const renderItem = (item) => {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @validateRefAccessDuringRender @validateRefAccessDuringRenderFunctionExpressions
|
||||
// @validateRefAccessDuringRender
|
||||
function Component(props) {
|
||||
const ref = useRef(null);
|
||||
const renderItem = (item) => {
|
||||
|
||||
Reference in New Issue
Block a user