Image is not working as expected
See original GitHub issue🐛 Bug report
While using the Image component this is what I get.
Unhandled Runtime Error
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
This is the code snippet
import {Box, Center, Flex, HStack, Image as Img} from '@chakra-ui/react';
I don’t know if I am making a stupid mistake or if this is a real issue
<Box w={100}> <Img src="https://via.placeholder.com/200x60" /> </Box>
🌍 System information
Software | Version(s) |
---|---|
Chakra UI | 1.0.3 |
Browser | Mozilla |
Operating System | Windows 10 |
📝 Additional information
Unhandled Runtime Error
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
7 Reasons Why Images Are Not Loading on Your Website
7 Reasons Why Images Are Not Loading on Your Website · 1. Incorrect File Paths · 2. Files Names Misspelled · 3. Wrong...
Read more >CSS background image is not working as expected
For some reason image background set via background is not working. Developer tools in both Chrome and Firefox are showing that the image...
Read more >How to handle loading of images that may not exist?
How to handle loading of images that may not exist? · 1. Periodic data cleanup · 2. Handle it in your application ·...
Read more >Improving the Image Loading Experience
Over time several techniques have been established to help improve how images load on a page, both for speed and to improve the...
Read more >How to fix CSS background-image not working | HTML/CSS
If the image isn't showing up, but you aren't getting any 404 errors, go into the code inspector and check the element itself....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @quarterpound, I’d recommend switching the
Image
component toImg
from@chakra-ui/react
when using Next.jsThat was the problem thank you