unable to load background #10218
Answered
by
asturur
vaynevayne
asked this question in
Q&A
-
Loading the background image with the following code will cause an error. I don't know where the problem is. Can you help me take a look? stackblitz: https://stackblitz.com/edit/vitejs-vite-sujben?file=src%2FFabric.tsx <ReactFabric
backgroundImage={
new FabricImage(
'https://img-home.csdnimg.cn/images/20240218021830.png',
{
width: 500,
height: 500,
originX: 'left',
originY: 'top',
crossOrigin: 'anonymous',
}
)
}
</ReactFabric> |
Beta Was this translation helpful? Give feedback.
Answered by
asturur
Oct 17, 2024
Replies: 1 comment 3 replies
-
You should get a typescript error telling you that FabricImage does not accept a string as first argument. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No the api to load an image is already very simple
Creating an app with react hooks and a canvas is complex enough, loading resources is something the developer has sort out anyway, moving that complexity in fabricJS is not advisable.
We need to remove functionality not cover tasks a developer has to do anyway.