Refactor StreamTabPanel and use hoistStatics for all hocs

This commit is contained in:
Chi Vinh Le
2017-08-16 22:07:25 +07:00
parent 33aea66ff7
commit 9ce6ab108a
11 changed files with 195 additions and 104 deletions
+3 -2
View File
@@ -8,8 +8,9 @@ import {withAddTag, withRemoveTag} from 'coral-framework/graphql/mutations';
import withFragments from 'coral-framework/hocs/withFragments';
import {addNotification} from 'coral-framework/actions/notification';
import {forEachError, isTagged} from 'coral-framework/utils';
import hoistStatics from 'recompose/hoistStatics';
export default (tag) => (WrappedComponent) => {
export default (tag) => hoistStatics((WrappedComponent) => {
if (typeof tag !== 'string') {
console.error('Tag must be a valid string');
return null;
@@ -109,4 +110,4 @@ export default (tag) => (WrappedComponent) => {
WithTags.displayName = `WithTags(${getDisplayName(WrappedComponent)})`;
return enhance(WithTags);
};
});