Skip to content

Conversation

@erikras
Copy link
Member

@erikras erikras commented May 27, 2019

Fixes #400.

Flow will not allow a union type of Function | null, which is how the parse and format API was designed. That was a terrible design. This is breaking change. To achieve what was previous achievable with passing null to parse or format can now be achieved by passing the identity function, v => v.

@erikras erikras merged commit de0f627 into master May 27, 2019
@erikras erikras deleted the parse-format-api-change branch May 27, 2019 09:43
if (formatOnBlur) {
value = defaultFormat(value, name)
} else if (format) {
if (component === 'input') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks cases where component is a custom adapter: #514

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikras any chance you could have a look at this? it's currently preventing us from updating from 4.1 right now :/

@lock
Copy link

lock bot commented Jul 11, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not set parse or format to null with Flow

3 participants