Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,207 changes: 2,514 additions & 693 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
"devDependencies": {
"@types/react": "^16.0.40",
"babel-eslint": "^8.0.3",
"babel-jest": "^22.4.1",
"babel-jest": "^22.4.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"bundlesize": "^0.16.0",
"doctoc": "^1.3.0",
"eslint": "^4.18.2",
"eslint": "^4.19.1",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-flowtype": "^2.46.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.7.0",
"final-form": "^4.3.0",
"flow-bin": "^0.67.1",
"final-form": "^4.4.0",
"flow-bin": "^0.68.0",
"glow": "^1.2.2",
"husky": "^0.14.3",
"jest": "^22.4.2",
"jest": "^22.4.3",
"lint-staged": "^7.0.0",
"nps": "^5.8.2",
"nps-utils": "^1.5.0",
Expand All @@ -59,11 +59,11 @@
"raf": "^3.4.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"rollup": "^0.56.5",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-flow": "^1.1.1",
"rollup-plugin-node-resolve": "^3.2.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0",
"tslint": "^5.9.1",
Expand Down
6 changes: 3 additions & 3 deletions src/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ export default class Field extends React.Component<Props, State> {
value = ''
}
const input = { name, value, ...this.handlers }
if (rest.type === 'checkbox') {
if ((rest: Object).type === 'checkbox') {
if (_value === undefined) {
input.checked = !!value
} else {
input.checked = !!(Array.isArray(value) && ~value.indexOf(_value))
input.value = _value
}
} else if (rest.type === 'radio') {
} else if ((rest: Object).type === 'radio') {
input.checked = value === _value
input.value = _value
}
if (component === 'select' && rest.multiple) {
if (component === 'select' && (rest: Object).multiple) {
input.value = input.value || []
}

Expand Down
2 changes: 1 addition & 1 deletion src/FormSpy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Form from './ReactFinalForm'
import Field from './Field'
import FormSpy from './FormSpy'

const onSubmitMock = values => {}
const onSubmitMock = () => {}
const hasFormApi = props => {
expect(typeof props.batch).toBe('function')
expect(typeof props.blur).toBe('function')
Expand Down
2 changes: 1 addition & 1 deletion src/ReactFinalForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class ReactFinalForm extends React.Component<Props, State> {
this.unsubscriptions = []
if (this.form) {
// set initial state
let initialState: FormState
let initialState: FormState = {}
this.form.subscribe((state: FormState) => {
initialState = state
}, subscription || all)()
Expand Down
4 changes: 2 additions & 2 deletions src/getValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const getValue = (
if (
!isReactNative &&
event.nativeEvent &&
event.nativeEvent.text !== undefined
(event.nativeEvent: Object).text !== undefined
) {
return event.nativeEvent.text
return (event.nativeEvent: Object).text
}
if (isReactNative && event.nativeEvent) {
return (event.nativeEvent: any).text
Expand Down
10 changes: 9 additions & 1 deletion src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
import * as React from 'react'
import type { FieldProps, FormProps, FormSpyProps } from './types'

export type { ReactContext } from './types'
export type {
FieldProps,
FieldRenderProps,
FormProps,
FormRenderProps,
FormSpyProps,
FormSpyRenderProps,
ReactContext
} from './types'

declare export var Field: React.ComponentType<FieldProps>
declare export var Form: React.ComponentType<FormProps>
Expand Down
2 changes: 1 addition & 1 deletion src/renderComponent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import renderComponent from './renderComponent'
describe('renderComponent', () => {
it('should pass both render and children prop', () => {
const children = 'some children'
const render = () => 'examplary render function'
const render = () => {}
const props = {
component: () => null,
children,
Expand Down