Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use editor-pro #11

Open
fullergalway opened this issue Jun 9, 2022 · 4 comments
Open

How to use editor-pro #11

fullergalway opened this issue Jun 9, 2022 · 4 comments

Comments

@fullergalway
Copy link

This project looks very useful.

import Editor from '@data-driven-forms/editor-pro/editor'
...
<Editor componentMapper={componentMapper} fields={fields}/>

How to get the field changes? (Will the dnd useState hook work from outside the Editor?)

@rvsia
Copy link
Collaborator

rvsia commented Jun 9, 2022

Hello, we are still discovering how to use it as it is still a work-in-progress project, however, fields is just a regular DDF scheme. Check the implementation to see more details, as we haven’t written any docs yet.

We are planning to split the current propertiesFields method to some builder/multiple methods so consumers can use our provided fields in their structures etc.

The hook won’t work outside the editor as it is need its context.

We will appreciate any feedback!

@fullergalway
Copy link
Author

Thanks.

So how about something like this, or is it too meta?

import FieldsComponent from '@data-driven-forms/editor-pro/fields-component'

const componentMapper = {
  'ddf-fields': FieldsComponent
}
const schema = {
  fields: [{
    component: 'ddf-fields',
    name: 'fields',
   }]
}

@rvsia
Copy link
Collaborator

rvsia commented Jun 10, 2022

@fullergalway this would be too meta. We aim to provide a consistent experience for developers - so the editor itself is just a ddf form, so it is easy to update.

@fullergalway
Copy link
Author

fullergalway commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants