mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
[DevTools] Avoid tearing Suspense store (#34294)
This commit is contained in:
committed by
GitHub
parent
00aa04c37d
commit
cf78fcfb3b
+1
-1
@@ -55,7 +55,7 @@ function SuspenseRects({
|
||||
|
||||
const suspense = store.getSuspenseByID(suspenseID);
|
||||
if (suspense === null) {
|
||||
console.warn(`<Element> Could not find suspense node id ${suspenseID}`);
|
||||
// getSuspenseByID will have already warned
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -81,7 +81,7 @@ function SuspenseTreeContextController({children}: Props): React.Node {
|
||||
|
||||
useEffect(() => {
|
||||
const handleSuspenseTreeMutated = () => {
|
||||
transitionDispatch({
|
||||
dispatch({
|
||||
type: 'HANDLE_SUSPENSE_TREE_MUTATION',
|
||||
});
|
||||
};
|
||||
@@ -91,7 +91,7 @@ function SuspenseTreeContextController({children}: Props): React.Node {
|
||||
// At the moment, we can treat this as a mutation.
|
||||
// We don't know which Elements were newly added/removed, but that should be okay in this case.
|
||||
// It would only impact the search state, which is unlikely to exist yet at this point.
|
||||
transitionDispatch({
|
||||
dispatch({
|
||||
type: 'HANDLE_SUSPENSE_TREE_MUTATION',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user