Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add immutableProps option to Field component #3849

Merged
merged 1 commit into from
Mar 7, 2018

Conversation

itsuryev
Copy link
Contributor

Fixes #3810

@codecov-io
Copy link

codecov-io commented Feb 20, 2018

Codecov Report

Merging #3849 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3849   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          70      70           
  Lines        1627    1629    +2     
======================================
+ Hits         1627    1629    +2
Impacted Files Coverage Δ
src/createField.js 100% <ø> (ø) ⬆️
src/ConnectedField.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b302e6f...2252bc4. Read the comment docs.

@erikras
Copy link
Member

erikras commented Mar 2, 2018

Can you add a test to get code coverage back up to 100%?

@itsuryev itsuryev force-pushed the immutableProps-field branch 3 times, most recently from e723a5b to a43d2db Compare March 3, 2018 12:24
@itsuryev
Copy link
Contributor Author

itsuryev commented Mar 3, 2018

Updated the code, now test coverage is back to 100%.

I might be missing something but I believe that drop in coverage was in error - any assignments in shouldComponentUpdate marked onChange for ReactNative in handleChange as uncovered.

So following decreases coverage:

shouldComponentUpdate(nextProps: Props) {
  const nextPropsKeys = Object.keys(nextProps)
  const thisPropsKeys = Object.keys(this.props)
  const {immutableProps = []} = nextProps

  // or even
  const hello = "world"

And inlining immutableProps usage works fine:

if (~(nextProps.immutableProps || []).indexOf(prop)) {

@itsuryev itsuryev force-pushed the immutableProps-field branch 2 times, most recently from babd298 to 0cbafe2 Compare March 3, 2018 12:48
@erikras erikras merged commit 2811705 into redux-form:master Mar 7, 2018
@itsuryev itsuryev deleted the immutableProps-field branch March 7, 2018 10:46
@lock
Copy link

lock bot commented Jun 1, 2018

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 Jun 1, 2018
@erikras
Copy link
Member

erikras commented Jun 12, 2018

Released in v7.4.0.

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.

None yet

3 participants