react-native-my-survey-sdk 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -149,7 +149,9 @@ export const XeboSurveyModal: React.FC = () => {
|
|
|
149
149
|
const lastRealIndex = questions.findIndex(q => q.id === 'thank_you_auto') - 1;
|
|
150
150
|
const isLast = questionIndex === lastRealIndex;
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
// key={question.id} forces React to unmount/remount on question change,
|
|
153
|
+
// resetting all component state (selected score, text, etc.)
|
|
154
|
+
const commonProps = { key: question.id, question, isLastQuestion: isLast, onAnswer: handleAnswer };
|
|
153
155
|
|
|
154
156
|
switch (question.type) {
|
|
155
157
|
case XeboQuestionType.singleChoice:
|