Skip to content

Conversation

@IvanScoles
Copy link
Collaborator

React context api

Date: 11-07-2018

  • New version from react 16.3.0
  • Using context with AppProvider and AppConsumer
  • Running application using AppConsumer with initial state
  • Fixing broken tests

@mravinale mravinale changed the title React context api [WIP] React context api Jul 11, 2018
};

export const UsersContext = React.createContext({
...users
Copy link
Member

Choose a reason for hiding this comment

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

Spread operator is not cloning the fetch object, it's values are passed by reference, the spread is one level deep cloning, so you are unexpectedly mutating the users const whem the fetch fields are updated, I would better use lodash cloneDeep.

@javier-pepe javier-pepe changed the base branch from master to develop July 17, 2018 22:15
@mravinale mravinale added DO NOT MERGE! Don't merge this PR, Something my be broken Feature A new feature/functionality/improvement and removed DO NOT MERGE! Don't merge this PR, Something my be broken labels Jul 18, 2018
@mravinale mravinale requested a review from javier-pepe July 23, 2018 13:14
@mravinale mravinale changed the title [WIP] React context api React context api Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature A new feature/functionality/improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants