diff --git a/.changeset/strong-adults-divide.md b/.changeset/strong-adults-divide.md new file mode 100644 index 0000000000..9872d03ae8 --- /dev/null +++ b/.changeset/strong-adults-divide.md @@ -0,0 +1,5 @@ +--- +'@talend/react-containers': patch +--- + +fix(HeaderBar): TypeError: Assignment to constant variable. diff --git a/packages/containers/src/HeaderBar/HeaderBar.connect.js b/packages/containers/src/HeaderBar/HeaderBar.connect.js index b3155d7a70..0f91cbe6ee 100644 --- a/packages/containers/src/HeaderBar/HeaderBar.connect.js +++ b/packages/containers/src/HeaderBar/HeaderBar.connect.js @@ -5,7 +5,7 @@ import Constants from './HeaderBar.constant'; const getHeaderActionProps = (actionName, ownProps, state) => { const expression = get(ownProps, `${actionName}.renderIfExpression`); - const actionProps = null; + let actionProps = ownProps[actionName]; if (expression) { actionProps = { diff --git a/packages/containers/src/HeaderBar/HeaderBar.test.js b/packages/containers/src/HeaderBar/HeaderBar.test.js index aa77087b96..03edd20c91 100644 --- a/packages/containers/src/HeaderBar/HeaderBar.test.js +++ b/packages/containers/src/HeaderBar/HeaderBar.test.js @@ -134,8 +134,8 @@ describe('Connected HeaderBar', () => { const props = mapStateToProps(state, ownProps); expect(props).toEqual({ - callToAction: null, - genericAction: null, + callToAction: undefined, + genericAction: undefined, productsItems: undefined, }); });