(NOBRIDGE) WARN [Layout children]: No route named "inspection/[projectId]/[itemId]" exists in nested children: ["+not-found", "login", "new-project", "_sitemap", "(auth)", "(tabs)", "add-item/[projectId]", "inspection-details/[id]", "inspection", "project/[id]"] [Component Stack]
/inspection/[projectId]/[itemId].tsx
export default function InspectionScreen() {
const { projectId, itemId } = useLocalSearchParams();
const router = useRouter();
const [itemName, setItemName] = useState('');
const [serialNumber, setSerialNumber] = useState<string | null>(null);
const [isScannerVisible, setIsScannerVisible] = useState(false);
const [hasPermission, setHasPermission] = useState<boolean | null>(null);
const [scanned, setScanned] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const [questions, setQuestions] = useState<Question[]>([]);
const [answers, setAnswers] = useState<Answer[]>([]);
const [isSaving, setIsSaving] = useState(false);
const [refreshing, setRefreshing] = useState(false);
// Memoize the loadData function to prevent unnecessary recreations
const loadData = useCallback(async () => {
if (!projectId || !itemId) return;
try {
setIsLoading(true);
// Fetch item details
const item = await db.getItem(itemId as string);
if (item) {
setItemName(item.name);
setSerialNumber(item.serial_number);
}
Here is the directory structure of my app: Directory tree
This is how I call the item inspection to save
Alert.alert(
'Success',
`Inspection ${status} successfully`,
[{
text: 'OK',
onPress: () => {
router.push({
pathname: '/project/[id]',
params: { id: projectId as string, refresh: 'true' }
});
}
}]
);
This is my code to access the item inspection in
project/[id].tsx
<View style={styles.itemActions}>
<TouchableOpacity
style={styles.itemActionButton}
onPress={() => router.push(`/inspection/${id}/${item.id}`)}
>
<Edit size={16} color="#007AFF" />
<Text style={styles.itemActionText}>Inspect</Text>
</TouchableOpacity>
I have tried creating a new _layout.tsx for the folder [projectId] but still nothing.
It displays the correct item to inspect on web, but whenever I go to Expo Go, it shows "This screen doesn't exist."
Please help!
Any help would be amazing!