fix: delete Object.fromEntries ponyfill cause of bugs
This commit is contained in:
parent
1601626fd9
commit
4058b48959
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-component-form",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-component-form",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "Manage React Forms with ease.",
|
||||
"author": "Divlo <contact@divlo.fr>",
|
||||
"license": "MIT",
|
||||
|
@ -1,9 +0,0 @@
|
||||
/*! fromentries. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
export function fromEntries<T = any>(
|
||||
iterable: Iterable<readonly [PropertyKey, T]>
|
||||
) {
|
||||
return [...iterable].reduce((object, [key, value]) => {
|
||||
object[key] = value
|
||||
return object
|
||||
}, {})
|
||||
}
|
@ -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<FormDataEntryValue>(new FormData(formElement))
|
||||
return Object.fromEntries<FormDataEntryValue>(new FormData(formElement))
|
||||
}
|
||||
|
||||
const Form = (props: FormProps): JSX.Element => {
|
||||
|
Reference in New Issue
Block a user