Consider dispatch function from useActionState non-reactive (#29917)

Updated version of #29758 removing `useFormState` since that was the
previous name for `useActionState`.

---------

Co-authored-by: Hieu Do <hieudn.uh@gmail.com>
This commit is contained in:
Joseph Savona
2024-06-17 12:26:55 -07:00
committed by GitHub
parent 107a2f8c3e
commit ddcecbbebf
7 changed files with 129 additions and 13 deletions
@@ -15,8 +15,7 @@ import {
Place,
computePostDominatorTree,
getHookKind,
isDispatcherType,
isSetStateType,
isStableType,
isUseOperator,
} from "../HIR";
import { PostDominator } from "../HIR/Dominator";
@@ -220,10 +219,7 @@ export function inferReactivePlaces(fn: HIRFunction): void {
if (hasReactiveInput) {
for (const lvalue of eachInstructionLValue(instruction)) {
if (
isSetStateType(lvalue.identifier) ||
isDispatcherType(lvalue.identifier)
) {
if (isStableType(lvalue.identifier)) {
continue;
}
reactiveIdentifiers.markReactive(lvalue);