CRA 4.0 dynamic image import #10039
Unanswered
msveshnikov
asked this question in
General
Replies: 1 comment
-
V4 is a major release, which by definition mean it has breaking changes https://semver.org |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Found nice breaking change 👍
Suppopse you have:
const image = require("./../../assets/images/${category[1]}.png");
This is not working in CRA 4.0:
map.loadImage(image, function (error, image) {});
This is working:
map.loadImage(image.default, function (error, image) {});
Beta Was this translation helpful? Give feedback.
All reactions