Skip to content

Commit 1e0a0b8

Browse files
committed
moves formprovider to app.tsx instead of entrypoint
1 parent 0eac7b3 commit 1e0a0b8

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/App.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ export const App = () => (
3434
<Route
3535
path=':pageKey'
3636
element={
37-
<PresentationComponent type={PresentationType.Stateless}>
38-
<Form />
39-
</PresentationComponent>
37+
<FormProvider>
38+
<PresentationComponent type={PresentationType.Stateless}>
39+
<Form />
40+
</PresentationComponent>
41+
</FormProvider>
4042
}
4143
/>
4244
<Route

src/features/entrypoint/Entrypoint.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Navigate, Outlet } from 'react-router-dom';
33

44
import { Loader } from 'src/core/loading/Loader';
55
import { useApplicationMetadata } from 'src/features/applicationMetadata/ApplicationMetadataProvider';
6-
import { FormProvider } from 'src/features/form/FormContext';
76
import { InstantiateContainer } from 'src/features/instantiate/containers/InstantiateContainer';
87
import { NoValidPartiesError } from 'src/features/instantiate/containers/NoValidPartiesError';
98
import {
@@ -31,11 +30,7 @@ const ShowOrInstantiate: React.FC<{ show: ShowTypes }> = ({ show }) => {
3130
}
3231

3332
// If the show type is something else, it points to a layout set that describes a stateless form.
34-
return (
35-
<FormProvider>
36-
<Outlet />
37-
</FormProvider>
38-
);
33+
return <Outlet />;
3934
};
4035

4136
export const Entrypoint = () => {
@@ -55,11 +50,7 @@ export const Entrypoint = () => {
5550
// Anonymous stateless app. No need to log in and select party, but cannot create a new instance.
5651
// The regular stateless mode (where you have to log in) is handled in ShowOrInstantiate, after the party is
5752
// selected and valid.
58-
return (
59-
<FormProvider>
60-
<Outlet />
61-
</FormProvider>
62-
);
53+
return <Outlet />;
6354
}
6455

6556
if (!profile) {

0 commit comments

Comments
 (0)