[UI > Settings] Do not re-set render
in CustomPage
This commit is contained in:
parent
c4a25744d4
commit
0f912c28e7
1 changed files with 3 additions and 2 deletions
|
@ -4,6 +4,7 @@ import { after } from "@lib/patcher";
|
||||||
import { installPlugin } from "@lib/plugins";
|
import { installPlugin } from "@lib/plugins";
|
||||||
import { installTheme } from "@lib/themes";
|
import { installTheme } from "@lib/themes";
|
||||||
import findInReactTree from "@utils/findInReactTree";
|
import findInReactTree from "@utils/findInReactTree";
|
||||||
|
import without from "@utils/without";
|
||||||
import ErrorBoundary from "@ui/components/ErrorBoundary";
|
import ErrorBoundary from "@ui/components/ErrorBoundary";
|
||||||
import SettingsSection from "@ui/settings/components/SettingsSection";
|
import SettingsSection from "@ui/settings/components/SettingsSection";
|
||||||
import InstallButton from "@ui/settings/components/InstallButton";
|
import InstallButton from "@ui/settings/components/InstallButton";
|
||||||
|
@ -47,9 +48,9 @@ export default function initSettings() {
|
||||||
},
|
},
|
||||||
VendettaCustomPage: {
|
VendettaCustomPage: {
|
||||||
title: "Vendetta Page",
|
title: "Vendetta Page",
|
||||||
render: ({ render: PageView, ...options }: { render: React.ComponentType }) => {
|
render: ({ render: PageView, ...options }: { render: React.ComponentType } & Record<string, object>) => {
|
||||||
const navigation = NavigationNative.useNavigation();
|
const navigation = NavigationNative.useNavigation();
|
||||||
React.useEffect(() => options && navigation.setOptions(options), []);
|
React.useEffect(() => options && navigation.setOptions(without(options, "render")), []);
|
||||||
// TODO: Is wrapping this in ErrorBoundary a good idea?
|
// TODO: Is wrapping this in ErrorBoundary a good idea?
|
||||||
return <ErrorBoundary><PageView /></ErrorBoundary>;
|
return <ErrorBoundary><PageView /></ErrorBoundary>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue