Skip to main content

All Questions

Tagged with
0 votes
1 answer
18 views

How to Convert SVG Icon String to React Component in WordPress?

I'm working on a WordPress project where I allow users to select SVG icons from a set. After an icon is selected, its SVG markup is stored in the Redux store as a string. I need to render this stored ...
sanjeev gwachha's user avatar
-2 votes
0 answers
30 views

How is this React component library able to use drag and drop on SVGs?

First off, this is NOT a duplicate of all those other questions trying to implement drag and drop for svgs and answerers telling them they can't - somehow this code I'm reading HAS done it, and I can'...
Aaron's user avatar
  • 43
0 votes
0 answers
29 views

vite-plugin-svgr - How to really generate viewBox from svg sizes?

I need to generate viewbox for svg from their height and width. I tried this options in vite.config.ts: svgr({ include: '**/*.svg?react', svgrOptions: { svgo: true, svgoConfig: { ...
Nosty's user avatar
  • 87
0 votes
2 answers
70 views

Moon phase graphic in TypeScript incorrectly renders waxing and waning phases

I am working on a React/TypeScript component that renders the phases of the moon based on a value between 0 and 1. The issue is that the moon phases are not rendering correctly between the First ...
Best Codes's user avatar
0 votes
0 answers
39 views

Merge blocks created by svg path

My react web app has over 2000 blocks that created by svg path. Users can select the blocks they need and merge them to a large block. The sides of selected blocks must be adjacent. The problem is I ...
Shuo's user avatar
  • 2,478
0 votes
0 answers
15 views

Jest Unit Test of a React component fails because of MUI SvgIcon: TypeError: Cannot read properties of null (reading 'useContext')

I am testing a React Component that implements MUI. Once I added a MUI SvgIcon (RefreshIcon), the unit test fails because of: "TypeError: Cannot read properties of null (reading 'useContext')&...
amnahn's user avatar
  • 1
0 votes
0 answers
29 views

React Native: TypeError with SvgText component on Android but not on iOS

Problem I'm working on a React Native project using TypeScript and react-native-svg to create an AttendanceCard component that includes a circular progress chart and percentage text. The component ...
hamjeth Misree's user avatar
0 votes
0 answers
42 views

How to Inject Color and Control Size of Dynamically Fetched SVGs in React?

I'm working on a React application where I need to fetch SVG icons from a URL and apply a custom color to them based on a value from my Redux store. Additionally, I want to ensure that the SVG scales ...
bo bo's user avatar
  • 1
0 votes
1 answer
57 views

How to add div or text in svg tag, which I imported from gatewaves.io?

I want to add div or text in svg tag ,which imported from getwaves.io, I have added but not showing. import React from "react"; import "../styles/About.css"; const About = () =&...
Paras Chouhan's user avatar
0 votes
0 answers
32 views

SVG not rendering properly in IOS safari browser using React Native Web

I have application made on React Native Web. I have a SVG Component Which is rendered correctly in new ios and android device browser. But in some IOS ( 12, 13, 15 ) it is not rendering. When I ...
user25075949's user avatar
-1 votes
1 answer
48 views

SVG is different only on Iphones but working fine on rest of the devices [closed]

Android iPhone Why is the toggle SVG reacting that way on iPhones, whereas it is working fine on Android devices, PC, laptops, etc? Where could be the issue be? SVG code: <label className="...
Talha Abdur Raheem's user avatar
1 vote
1 answer
24 views

Cannot import SVG file into React project [closed]

Can someone tell me how to import an GVS image into a React project? I created the project using parcel and not create-react-app. I tried exporting as a component using ReactComponent and also ...
Karthik Tej's user avatar
1 vote
2 answers
71 views

Can't use SVG in next.js

I have an .svg file in my project which I want to import: import Logo from "@/assets/logo.svg"; import Image from "next/image"; import MenuIcon from "@/assets/menu.svg"; ...
SWE's user avatar
  • 29
-1 votes
1 answer
39 views

How to resize an SVG without also resizing the background

I want to use SVG as logo of my website. I tried to resize it by modifying its width and height, but it doesn't work, because it resizes the whole image. I also tried these solutions: Resizing SVG in ...
anandsingh's user avatar
0 votes
0 answers
28 views

Why does pasting an image into an SVG canvas only works if there are other elements present (like an SVG circle) in my webapp?

I am working on a map creation project in React. It consists of a 'canvas', which is an svg element. On that canvas, you can add nodes, which are SVG circles, edges, which as SVG lines and finally you ...
tarte_au_citron's user avatar

15 30 50 per page
1
2 3 4 5
134