This commit is contained in:
Dan
2019-04-05 13:19:39 +01:00
committed by Dan Abramov
parent 48a5aca127
commit b8245de5a1
4 changed files with 6 additions and 7 deletions
-1
View File
@@ -32,7 +32,6 @@ function mountTestApp() {
mountHelper(ElementTypes);
mountHelper(EditableProps);
mountHelper(DeeplyNestedComponents);
mountHelper(SuspenseTree);
}
function unmountTestApp() {
+3 -3
View File
@@ -226,7 +226,7 @@ export function attach(
setSuspenseHandler,
scheduleUpdate,
} = renderer;
const supportsEditingSuspense =
const supportsTogglingSuspense =
typeof setSuspenseHandler === 'function' &&
typeof scheduleUpdate === 'function';
@@ -1443,8 +1443,8 @@ export function attach(
// Does the current renderer support editable function props?
canEditFunctionProps: typeof overrideProps === 'function',
canEditSuspense:
supportsEditingSuspense &&
canToggleSuspense:
supportsTogglingSuspense &&
// If it's showing the real content, we can always flip fallback.
(!isTimedOutSuspense ||
// If it's showing fallback because we previously forced it to,
@@ -126,7 +126,7 @@ function InspectedElementView({
const {
canEditFunctionProps,
canEditHooks,
canEditSuspense,
canToggleSuspense,
context,
hooks,
owners,
@@ -165,7 +165,7 @@ function InspectedElementView({
const rendererID = store.getRendererIDForElement(id);
bridge.send('overrideProps', { id, path, rendererID, value });
};
} else if (type === ElementTypeSuspense && canEditSuspense) {
} else if (type === ElementTypeSuspense && canToggleSuspense) {
overrideSuspenseFn = (path: Array<string | number>, value: boolean) => {
if (path.length !== 1 && path !== IS_SUSPENDED) {
throw new Error('Unexpected path.');
+1 -1
View File
@@ -42,7 +42,7 @@ export type InspectedElement = {|
canEditFunctionProps: boolean,
// Is this Suspense, and can its value be overriden now?
canEditSuspense: boolean,
canToggleSuspense: boolean,
// Can view component source location.
canViewSource: boolean,