PromucFlow_constructor/app/client/src/components/fields/JSONEditorField.tsx

18 lines
405 B
TypeScript
Raw Normal View History

2019-10-21 15:12:45 +00:00
import React from "react";
import { Field } from "redux-form";
import JSONEditor from "../editor/JSONEditor";
const JSONEditorField = (props: { name: string }) => {
return (
<Field
name={props.name}
component={JSONEditor}
format={(value: string | object) =>
typeof value === "string" ? value : JSON.stringify(value)
}
/>
);
};
export default JSONEditorField;