Skip to content

poetic/react-jsonschema-form-reference-schema-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-jsonschema-form-reference-schema-wrapper

travis npm semantic-release

Usage

  • Wrap JSON schema form with this function:

    import Form from 'react-jsonschema-form';
    const WrappedForm = referenceSchemaWrapper(
      Form,
      {
        findRefs,
        parse: EJSON.parse,
        stringify: EJSON.stringify,
      }
    )
    
  • specify options in referenceSchema which should be passed into the form as a prop along with your schema

    {
      "domainId": {
        "$ref": "domains",
        "remoteKey": "_id",
        "remoteLabelKey": "name",
        "dependents": [
          { "key": "domainName", "remoteKey": "name" }
        ],
        "filters": [
          { "key": "active", "value": true }
        ]
      }
    }
    

Development

Build index.js file before using on local

npm run build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •