-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 usePureComponent option #357
Conversation
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.
what about the import shallowEqual from 'fbjs/lib/shallowEqual'; dependency introduced?
src/translate.js
Outdated
@@ -1,6 +1,7 @@ | |||
import React, { Component } from 'react'; | |||
import PropTypes from 'prop-types'; | |||
import hoistStatics from 'hoist-non-react-statics'; | |||
import shallowEqual from 'fbjs/lib/shallowEqual'; |
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.
does that not need additional dependency fbjs?
if so i would prefer not pulling in a that heavy dependency and prefer copy over of: https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/shallowEqual.js
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.
As we are already dependent to React
and react is dependent to fbjs
I thought this is ok! however if you think copying shallowEqual is a better option I can change it?
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.
runs also in preact -> that's why pulling in a dependency of react is a bad idea
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 I see
would it be possible to add a test case? so we get coverage up again...regarding the codeclimate that shallowEqual file could be excluded in the codeclimate.yml |
published with react-i18next@7.2.0 |
No description provided.