This repository has been archived by the owner on Apr 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Update forms to use custom Input ui component #281
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6cacaf2
Fix warning about missing key prop for iterated element in Home page
stephanethomas ea72b16
Bump React to latest available version
stephanethomas e9ad1ca
Filter out only props provided by redux-form via the fields prop
stephanethomas 1e86670
Fix invalid props passed to form elements
stephanethomas 0734c33
Update forms to use custom Input ui component
stephanethomas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,32 @@ export const getAsyncValidateFunction = validate => values => new Promise( ( res | |
} ); | ||
|
||
/** | ||
* Extract valid props to be given to an <input> element from an object (a set of props) containing other fields. | ||
* This function basically removes all custom props added by react-form. | ||
* See this issue in react-form: https://github.com/erikras/redux-form/issues/1249# | ||
* Extracts valid props to be given to a form element from an object (a set of props) containing other fields. This | ||
* function basically removes all custom props added by redux-form: | ||
* | ||
* @param {object} props - a set of props for an input element | ||
* @returns {object} props filtered | ||
* https://github.com/erikras/redux-form/issues/1249 | ||
* | ||
* This function should be removed once redux-form is upgraded to version 6. | ||
* | ||
* @param {object} props - a set of props for a form element | ||
* @returns {object} - the props filtered | ||
*/ | ||
export const removeInvalidInputProps = ( props ) => { | ||
const { active, autofill, autofilled, dirty, error, initialValue, invalid, onUpdate, pristine, touched, | ||
valid, visited, asyncValidating, autofocus, ...validProps } = props; | ||
const { | ||
active, | ||
autofill, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the purpose of removing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's because it's useless since it's not part of the list of props that |
||
autofilled, | ||
dirty, | ||
error, | ||
initialValue, | ||
invalid, | ||
onUpdate, | ||
pristine, | ||
touched, | ||
valid, | ||
visited, | ||
...validProps | ||
} = props; | ||
|
||
return validProps; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems v6 won't fix this, it just provides a cleaner syntax to create input components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok it has this
input
prop with all the valid properties