0

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.