diff --git a/package-lock.json b/package-lock.json index 19c339d..0f63b49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-component-form", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8c929e1..138b1b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-component-form", - "version": "1.2.0", + "version": "1.2.1", "description": "Manage React Forms with ease.", "author": "Divlo ", "license": "MIT", diff --git a/src/fromEntries.ts b/src/fromEntries.ts deleted file mode 100644 index a2b44c1..0000000 --- a/src/fromEntries.ts +++ /dev/null @@ -1,9 +0,0 @@ -/*! fromentries. MIT License. Feross Aboukhadijeh */ -export function fromEntries( - iterable: Iterable -) { - return [...iterable].reduce((object, [key, value]) => { - object[key] = value - return object - }, {}) -} diff --git a/src/index.tsx b/src/index.tsx index de37889..a8456e2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,5 +1,4 @@ import React, { useRef } from 'react' -import { fromEntries } from './fromEntries' export interface FormDataObject { [key: string]: FormDataEntryValue @@ -19,7 +18,7 @@ interface FormProps extends ReactFormProps { } const getFormDataObject = (formElement: HTMLFormElement): FormDataObject => { - return fromEntries(new FormData(formElement)) + return Object.fromEntries(new FormData(formElement)) } const Form = (props: FormProps): JSX.Element => {