I'm using json forms to generate forms from a json description. I'm trying to have cooperative filling (multiple users can work on one form at a time, and see changes in real time).
const store = syncedStore({
formData: {} as object
});
export default function JsonFormComponent() {
const state = useSyncedStore(store);
useEffect(() => {
new WebsocketProvider(
'ws://localhost:1234',
'my-room',
getYjsValue(store)
);
}, []);
<JsonForms
schema={schema}
uischema={uiSchema}
data={state.formData}
renderers={materialRenderers}
i18n={{locale: locale, translate: translation}}
onChange={({data, errors}) => {
Object.assign(state.formData, data);
}}
/>
}
But the data is not shared between users. I have no idea where the problem could be. Other examples (todos, code editor) work for me without any problems. The server is running.
Has anyone here solved a similar problem? I haven't found any ready-made or similar solutions on the internet.
thank you for your reply