Skip to content

Commit 8c09dac

Browse files
authored
fix(container): header bar assignment error (#4639)
1 parent 20f8526 commit 8c09dac

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/strong-adults-divide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@talend/react-containers': patch
3+
---
4+
5+
fix(HeaderBar): TypeError: Assignment to constant variable.

packages/containers/src/HeaderBar/HeaderBar.connect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Constants from './HeaderBar.constant';
55

66
const getHeaderActionProps = (actionName, ownProps, state) => {
77
const expression = get(ownProps, `${actionName}.renderIfExpression`);
8-
const actionProps = null;
8+
let actionProps = ownProps[actionName];
99

1010
if (expression) {
1111
actionProps = {

packages/containers/src/HeaderBar/HeaderBar.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ describe('Connected HeaderBar', () => {
134134
const props = mapStateToProps(state, ownProps);
135135

136136
expect(props).toEqual({
137-
callToAction: null,
138-
genericAction: null,
137+
callToAction: undefined,
138+
genericAction: undefined,
139139
productsItems: undefined,
140140
});
141141
});

0 commit comments

Comments
 (0)