OptimizedImage Debug Page
This page helps identify what causes the "Objects are not valid as a React child" error.
Current Test: string
Value: "/logo.png"
Type: string
OptimizedImage Component:
Debug Information
Check the browser console for any warnings or errors.
If you see the error "Objects are not valid as a React child", it means one of the test cases above is causing it.
Common Causes:
- Object with src property: Instead of passing
src="string", passing src={src: "string"} - File objects: Passing File/Blob objects directly instead of using URL.createObjectURL()
- Array values: Passing arrays instead of the first element
- Nested objects: Passing complex objects that contain the URL deep inside
How to Fix:
- Always pass strings to the src prop
- Use optional chaining safely:
data?.uploads?.[0] - For File objects:
src=URL.createObjectURL(file) - Check data structure before passing to component