Skip to content

Commit c30fdba

Browse files
committed
Testing prop change microweb
1 parent 168d87d commit c30fdba

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

CHANGES

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 15.2.0-beta9
2+
3+
---
4+
5+
- Testing prop change microweb
6+
17
## 15.2.0-beta8
28

39
---

src/components/index.tsx

+17-1
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,24 @@ class Refero extends React.Component<StateProps & DispatchProps & ReferoProps, S
9595
console.log("Skjemanavn: " + this.props.skjemanavn);
9696
}
9797

98-
componentDidUpdate(): void {
98+
componentDidUpdate(prevProps: ReferoProps): void {
9999
IE11HackToWorkAroundBug187484();
100+
// eslint-disable-next-line no-console
101+
console.log("Component did update called");
102+
if (this.props.skjemanavn !== prevProps.skjemanavn) {
103+
console
104+
// eslint-disable-next-line no-console
105+
console.log("skjemanavn has changed, calling updateSkjema...");
106+
if (this.props.questionnaire) {
107+
this.props.updateSkjema(
108+
this.props.questionnaire,
109+
this.props.questionnaireResponse,
110+
this.props.language,
111+
this.props.syncQuestionnaireResponse
112+
);
113+
this.setState({ scoringCalculator: this.getScoringCalculator(this.props.questionnaire) });
114+
}
115+
}
100116
}
101117

102118
componentWillUnmount(): void {

0 commit comments

Comments
 (0)