Skip to content

Commit

Permalink
Improve types (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHertal authored Dec 23, 2020
1 parent 58771fd commit 5879c50
Show file tree
Hide file tree
Showing 5 changed files with 351 additions and 385 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-admin-json-view",
"version": "1.0.2",
"version": "1.0.3",
"description": "JSON field and input for react-admin.",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion src/JsonField.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from "react";
import { FieldProps } from "react-admin";
import ReactJson, { ReactJsonViewProps } from "react-json-view";

type Props = {
source: string;
record?: any;
reactJsonOptions?: ReactJsonViewProps;
};
} & FieldProps;

export const JsonField: React.FC<Props> = ({
source,
Expand Down
6 changes: 3 additions & 3 deletions src/JsonInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormHelperText } from "@material-ui/core";
import React from "react";
import { InputHelperText, Labeled, useInput } from "react-admin";
import { InputHelperText, InputProps, Labeled, useInput } from "react-admin";
import ReactJson, {
InteractionProps,
ReactJsonViewProps,
Expand All @@ -10,7 +10,7 @@ type Props = {
source: string;
helperText?: string;
reactJsonOptions?: ReactJsonViewProps;
};
} & InputProps;

export const JsonInput: React.FC<Props> = (props) => {
const {
Expand Down Expand Up @@ -58,7 +58,7 @@ export const JsonInput: React.FC<Props> = (props) => {
</Labeled>
<FormHelperText error={!!(touched && error)}>
<InputHelperText
touched={touched}
touched={!!touched}
error={error}
helperText={helperText}
/>
Expand Down
1 change: 0 additions & 1 deletion src/typings.d.ts

This file was deleted.

Loading

0 comments on commit 5879c50

Please sign in to comment.