Skip to content

Commit

Permalink
feat #65 - Update hooks for form and Input exports
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 25, 2020
1 parent f79be9d commit 17d78d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/Form/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createUseStyles } from 'react-jss'
import FieldContext from './FieldContext'
import FormButton from './FormButton'
import FormButton, { FormButtonProps } from './FormButton'
import FormInput, { FormInputProps } from './FormInput'
import { FormProvider, useForm } from 'react-hook-form'
import React, { FC, ReactNode, useEffect } from 'react'
Expand All @@ -21,7 +21,7 @@ export interface FormProps {
}

interface FormSubComponents {
Button: FC
Button: FC<FormButtonProps>
Input: FC<FormInputProps>
}

Expand All @@ -38,7 +38,7 @@ const Form: FC<FormProps> & FormSubComponents = ({

useEffect(() => {
reset(initialValues)
}, [initialValues])
}, [initialValues, reset])

return (
<FormProvider {...methods}>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'antd/lib/input/style/index.css'
import { Input as AntDInput } from 'antd'
import cn from 'classnames'
import { createUseStyles } from 'react-jss'
import { Input } from 'antd'
import Skeleton from '../Skeleton'
import React, { FC } from 'react'

Expand Down Expand Up @@ -85,7 +85,7 @@ export interface InputProps {
value?: string
}

const InputField: FC<InputProps> = (props: InputProps) => {
const Input: FC<InputProps> = (props: InputProps) => {
const {
classes = [],
disabled = false,
Expand Down Expand Up @@ -123,7 +123,7 @@ const InputField: FC<InputProps> = (props: InputProps) => {
<InputFieldSkeleton {...props} />
) : (
<div className={componentClasses.container}>
<Input
<AntDInput
className={inputClasses}
disabled={disabled}
placeholder={placeholder}
Expand All @@ -134,4 +134,4 @@ const InputField: FC<InputProps> = (props: InputProps) => {
)
}

export default InputField
export default Input

0 comments on commit 17d78d2

Please sign in to comment.