Skip to content

Commit a78638a

Browse files
authored
Actually use react-lifecycles-compat polyfill (#277)
1 parent 2797f94 commit a78638a

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/Field.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22
import * as React from 'react'
3+
import { polyfill } from 'react-lifecycles-compat'
34
import PropTypes from 'prop-types'
45
import { fieldSubscriptionItems } from 'final-form'
56
import diffSubscription from './diffSubscription'
@@ -22,7 +23,7 @@ type State = {
2223
state: ?FieldState
2324
}
2425

25-
export default class Field extends React.Component<Props, State> {
26+
class Field extends React.Component<Props, State> {
2627
context: ReactContext
2728
props: Props
2829
state: State
@@ -233,3 +234,7 @@ export default class Field extends React.Component<Props, State> {
233234
)
234235
}
235236
}
237+
238+
polyfill(Field)
239+
240+
export default Field

src/FormSpy.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22
import * as React from 'react'
3+
import { polyfill } from 'react-lifecycles-compat'
34
import PropTypes from 'prop-types'
45
import { formSubscriptionItems } from 'final-form'
56
import diffSubscription from './diffSubscription'
@@ -15,7 +16,7 @@ import { all } from './ReactFinalForm'
1516

1617
type State = { state: FormState }
1718

18-
export default class FormSpy extends React.Component<Props, State> {
19+
class FormSpy extends React.Component<Props, State> {
1920
context: ReactContext
2021
props: Props
2122
state: State
@@ -200,3 +201,7 @@ export default class FormSpy extends React.Component<Props, State> {
200201
FormSpy.contextTypes = {
201202
reactFinalForm: PropTypes.object
202203
}
204+
205+
polyfill(FormSpy)
206+
207+
export default FormSpy

src/ReactFinalForm.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22
import * as React from 'react'
3+
import { polyfill } from 'react-lifecycles-compat'
34
import PropTypes from 'prop-types'
45
import {
56
configOptions,
@@ -38,7 +39,7 @@ type State = {
3839
state: FormState
3940
}
4041

41-
export default class ReactFinalForm extends React.Component<Props, State> {
42+
class ReactFinalForm extends React.Component<Props, State> {
4243
context: ReactContext
4344
props: Props
4445
state: State
@@ -288,3 +289,7 @@ export default class ReactFinalForm extends React.Component<Props, State> {
288289
)
289290
}
290291
}
292+
293+
polyfill(ReactFinalForm)
294+
295+
export default ReactFinalForm

0 commit comments

Comments
 (0)