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

Injection of custom ajv instance via prop (+ removal of global ajv) #1286

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Align internal name to file name (was AnyOfField internally, exported…
… as default by MultiSchemaField.js)
  • Loading branch information
sbusch committed May 17, 2019
commit 24f1acb35a4aa7bace5df0c8733ee26271ad176c
9 changes: 5 additions & 4 deletions src/components/fields/MultiSchemaField.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import * as types from "../../types";
import { getUiOptions, getWidget, guessType } from "../../utils";
import { isValid } from "../../validate";

class AnyOfField extends Component {
// Used as AnyOfField and OneOfField, see src/components/fields/index.js
class MultiSchemaField extends Component {
constructor(props) {
super(props);

Expand Down Expand Up @@ -198,15 +199,15 @@ class AnyOfField extends Component {
}
}

AnyOfField.defaultProps = {
MultiSchemaField.defaultProps = {
disabled: false,
errorSchema: {},
idSchema: {},
uiSchema: {},
};

if (process.env.NODE_ENV !== "production") {
AnyOfField.propTypes = {
MultiSchemaField.propTypes = {
options: PropTypes.arrayOf(PropTypes.object).isRequired,
baseType: PropTypes.string,
uiSchema: PropTypes.object,
Expand All @@ -217,4 +218,4 @@ if (process.env.NODE_ENV !== "production") {
};
}

export default AnyOfField;
export default MultiSchemaField;