@umituz/react-native-ai-generation-content 1.23.3 → 1.23.5

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": "@umituz/react-native-ai-generation-content",
3
- "version": "1.23.3",
3
+ "version": "1.23.5",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -49,6 +49,9 @@ export const CoupleFutureWizard: React.FC<CoupleFutureWizardProps> = ({
49
49
  });
50
50
 
51
51
  // Notify parent app when step changes
52
+ // NOTE: Do NOT include callbacks in dependencies - causes infinite loop!
53
+ // Parent app re-renders when onStepChange updates state, which recreates callbacks,
54
+ // which would retrigger this effect, creating infinite loop.
52
55
  useEffect(() => {
53
56
  if (flow.currentStep && callbacks?.onStepChange) {
54
57
  if (typeof __DEV__ !== "undefined" && __DEV__) {
@@ -60,7 +63,8 @@ export const CoupleFutureWizard: React.FC<CoupleFutureWizardProps> = ({
60
63
  }
61
64
  callbacks.onStepChange(flow.currentStep.id, flow.currentStep.type);
62
65
  }
63
- }, [flow.currentStep, flow.currentStepIndex, callbacks]);
66
+ // eslint-disable-next-line react-hooks/exhaustive-deps
67
+ }, [flow.currentStep, flow.currentStepIndex]);
64
68
 
65
69
  const handleScenarioPreviewContinue = useCallback(() => {
66
70
  if (typeof __DEV__ !== "undefined" && __DEV__) {
@@ -103,10 +107,26 @@ export const CoupleFutureWizard: React.FC<CoupleFutureWizardProps> = ({
103
107
 
104
108
  const renderCurrentStep = useCallback(() => {
105
109
  const step = flow.currentStep;
106
- if (!step) return null;
110
+ if (!step) {
111
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
112
+ console.log("[CoupleFutureWizard] renderCurrentStep: NO STEP");
113
+ }
114
+ return null;
115
+ }
116
+
117
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
118
+ console.log("[CoupleFutureWizard] renderCurrentStep", {
119
+ stepId: step.id,
120
+ stepType: step.type,
121
+ stepIndex: flow.currentStepIndex,
122
+ });
123
+ }
107
124
 
108
125
  switch (step.type) {
109
126
  case StepType.SCENARIO_SELECTION:
127
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
128
+ console.log("[CoupleFutureWizard] Rendering SCENARIO_SELECTION (null)");
129
+ }
110
130
  return null; // Rendered by parent via CategoryNavigationContainer
111
131
 
112
132
  case StepType.SCENARIO_PREVIEW:
@@ -136,6 +156,15 @@ export const CoupleFutureWizard: React.FC<CoupleFutureWizardProps> = ({
136
156
  : translations.partnerB;
137
157
  const partnerConfig = isPartnerA ? config.partnerA : config.partnerB;
138
158
 
159
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
160
+ console.log("[CoupleFutureWizard] Rendering PartnerStepScreen", {
161
+ isPartnerA,
162
+ stepId: step.id,
163
+ hasConfig: !!partnerConfig,
164
+ hasTranslations: !!partnerTranslations,
165
+ });
166
+ }
167
+
139
168
  return (
140
169
  <PartnerStepScreen
141
170
  key={isPartnerA ? "a" : "b"}
@@ -31,6 +31,9 @@ export function useAIGenerateWizardFlow({
31
31
  } = state;
32
32
 
33
33
  // Notify parent app when step changes
34
+ // NOTE: Do NOT include onStepChange in dependencies - causes infinite loop!
35
+ // Parent app re-renders when callback updates state, recreating the callback,
36
+ // which would retrigger this effect in an infinite loop.
34
37
  useEffect(() => {
35
38
  if (onStepChange) {
36
39
  if (typeof __DEV__ !== "undefined" && __DEV__) {
@@ -40,7 +43,8 @@ export function useAIGenerateWizardFlow({
40
43
  }
41
44
  onStepChange(currentStep);
42
45
  }
43
- }, [currentStep, onStepChange]);
46
+ // eslint-disable-next-line react-hooks/exhaustive-deps
47
+ }, [currentStep]);
44
48
 
45
49
  const imageCountRequired = useMemo(() => {
46
50
  if (!featureType || !hasAIFeature(featureType)) return 0;