Skip to content

Commit 980a4de

Browse files
committed
fix: framework setup
1 parent 3466e22 commit 980a4de

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/Form.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
* - All imports should be optional based on what gets selected
66
*/
77
// Library
8-
import React from 'react';
9-
import { nanoid as generate } from 'nanoid';
8+
import Framework from './universal-schema/react.framework';
9+
const {
10+
React,
11+
nanoId: generate,
12+
} = Framework.library;
1013

1114
// Material UI
1215
import { MuiPickersUtilsProvider } from '@material-ui/pickers'; // Has to be made optional
@@ -16,7 +19,6 @@ import CircularProgress from '@material-ui/core/CircularProgress';
1619

1720
// Types
1821
import { FormProps } from '@core-types/Form.type';
19-
import Framework from './universal-schema/react.framework';
2022

2123
// Internal
2224
import formStyles from './form-styles';
@@ -34,11 +36,6 @@ import {
3436
// Initial Contexts
3537
import { LoadingContext, EventContext, StepperContext } from './helpers/context';
3638

37-
// const {
38-
// React,
39-
// nanoId: generate,
40-
// } = Framework.library;
41-
4239
const Form = ({
4340
formData: originalFormData,
4441
schema = {},

src/universal-schema/react.framework.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { UniversalSchemaFramework } from './types/universal-schema-framework.typ
22

33
const Framework: UniversalSchemaFramework = {
44
library: {
5-
React: import('react'),
6-
nanoId: async () => (await import('nanoid')).nanoid,
5+
React: require('react'),
6+
nanoId: require('nanoid').nanoid,
77
},
88
uiFramework: {
99
name: 'MaterialUI',

0 commit comments

Comments
 (0)