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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-my-survey-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Xebo survey collection SDK for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -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
- const commonProps = { question, isLastQuestion: isLast, onAnswer: handleAnswer };
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: