fix(companion): add missing useEffect import and fix type errors #26960
+7
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a critical bug causing iOS and Android companion apps to crash when opening the availability detail page.
In PR #26931, the code was refactored to use
useEffectinstead ofuseMemofor side effects (as recommended by Cubic AI review), but the import statement was never updated to includeuseEffect. This caused a runtime error (useEffect is not defined) when the component tried to render.Updates since last revision
Fixed TypeScript type errors in
edit-availability-hours.tsxandedit-availability-hours.ios.tsx:useScheduleByIdhook returnsSchedule | undefined, but the component prop expectedSchedule | nullschedule ?? null) to convertundefinedtonullMandatory Tasks (DO NOT REMOVE)
How should this be tested?
Previously, the app would crash immediately when trying to open the availability detail page.
Checklist
Human Review Checklist
useEffectis correctly added to the React import in both AvailabilityDetailScreen filesschedule ?? null) doesn't change runtime behavior (convertsundefinedtonullfor type safety)Link to Devin run: https://app.devin.ai/sessions/292e159b683c42649f7286a32539d188
Requested by: Dhairyashil Shinde (@dhairyashiil)