Following this issue Improve react-native-svg for the web using @svgr/webpack · Issue #6660 · expo/expo · GitHub, I expected to see .svg
file being imported on the web as react component.
This is possible with @svgr/webpack
but that is not implemented. So far we have to rewrite the whole svg in another format.
I was not able to configure properly by creating my webpack.config.js
:
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
module.exports = async function(env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
config.module.rules.push({
test: /\.svg$/,
use: [
{
loader: '@svgr/webpack',
options: {
native: true,
},
},
],
});
return config;
};
I know it should be integrated within expo but it seems it’s not.
How can I configure SVG import of react component in expo SDK36 ?