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

Allow registering custom widgets #63

Closed
n1k0 opened this issue Mar 14, 2016 · 2 comments
Closed

Allow registering custom widgets #63

n1k0 opened this issue Mar 14, 2016 · 2 comments

Comments

@n1k0
Copy link
Collaborator

n1k0 commented Mar 14, 2016

Self-explanatory dream API:

import Form from "react-jsonschema-form";

const MyComponent = (props) => {
  // ....
};

const schema = {
  type: "string"
};

const widgets = {
  myComponent: MyComponent
};

const uiSchema = {
  "ui:widget": "myComponent"
};

render((<Form 
  schema={schema} 
  uiSchema={uiSchema} 
  widgets={widgets}
/>), document.querySelector("main"))

Context: as uiSchema should be defined using JSON (and no necessarily JavaScript), we need to expose a way to register a custom component and associate it with a string unique identifier we can later reference from the JSON definition.

/cc @leplatrem

@leplatrem leplatrem self-assigned this Mar 14, 2016
n1k0 added a commit that referenced this issue Mar 15, 2016
@n1k0
Copy link
Collaborator Author

n1k0 commented Mar 15, 2016

Basic PoC in #67

n1k0 added a commit that referenced this issue Mar 16, 2016
@n1k0
Copy link
Collaborator Author

n1k0 commented Mar 16, 2016

Fixed by #67.

@n1k0 n1k0 closed this as completed Mar 16, 2016
James-Brown98 pushed a commit to James-Brown98/react-jsonschema-form that referenced this issue Feb 24, 2022
Allow users to override default labels using mods
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