forked from blackjk3/react-form-builder
-
Notifications
You must be signed in to change notification settings - Fork 365
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (24 loc) · 786 Bytes
/
app.js
File metadata and controls
29 lines (24 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import { createRoot } from 'react-dom/client';
import DemoBar from './demobar';
// eslint-disable-next-line no-unused-vars
import FormBuilder, { Registry } from './src/index';
import * as variables from './variables';
// Add our stylesheets for the demo.
require('./scss/application.scss');
const url = '/api/formdata';
const saveUrl = '/api/formdata';
const App = () => (
<FormBuilder.ReactFormBuilder
variables={variables}
url={url}
saveUrl={saveUrl}
locale="en"
saveAlways={false}
// toolbarItems={items}
/>
);
const root = createRoot(document.getElementById('form-builder'));
root.render(<App />);
const demoBarRoot = createRoot(document.getElementById('demo-bar'));
demoBarRoot.render(<DemoBar variables={variables} />);