score:1
Accepted answer
i managed to use different colors by creating a component that return that svg and accept props
const icon = (props) => (
<svg>
<g>
<path fill={props.outside} />
<path fill={props.inside} />
</g>
</svg>
)
...
<icon outside='#000' inside='red'/>
Source: stackoverflow.com
Related Query
- Multiple color fill on SVG as component in React
- React - Ability to control fill color of an SVG through props
- Change SVG Fill color in React JS
- Using a random color for an SVG being exported as a React Component
- Change the color of an svg with multiple colors in react
- If I pass color props to svg component then color of svg is not changing in React
- Multiple path names for a same component in React Router
- How do I wrap a React component that returns multiple table rows and avoid the "<tr> cannot appear as a child of <div>" error?
- How do I add color to my svg image in react
- React component render is called multiple times when pushing new URL
- Exporting React component with multiple HOC wrappers?
- Can a react component have multiple areas for child content?
- React Native - how to use local SVG file (and color it)
- Turning an SVG string into an image in a React component
- React SVG component as background-image to div
- Passing multiple props to React component
- how to make material data grid width to fill the parent component in react js
- Add SVG markup to React component
- React SVG disappearing when component rerenders
- Create an interactive SVG component using React
- How to create a privately shared component library which can be used across multiple react projects
- Multiple instances of same react component
- React SVG import as a Component does not render
- Pass an inline SVG as React component prop
- Multiple times render in react functional component with hooks
- React multiple instances of same component are getting same state
- React : Firing a custom alert from multiple components using an existing component having its own styles
- Reusing multiple instances of react component with different props
- React - How to Export Multiple Components on same File, preventing <Unknown/> Component on Dev Tools
- what is proper way to import multiple components from same file in react instead of getting each component imported
More Query from same tag
- send the value as string when selecting the option
- React Hook "useState" is called in function "AAA" which is neither a React function component or a custom React Hook function
- react-select not updating selected value on initial select
- MongooseError [OverwriteModelError]: Cannot overwrite `Team` model once compiled
- CSS How to make a container the entire height of the browser window
- React + Redux - Component doesn't update after state change
- Pass values to the state from formik
- I want to open a new Tab in React application on button click?
- How do I reject writing value to Firebase if have the same value in my DB? (Javascript)
- react button is called before onPress when using Hooks
- How to enable serviceworker in heroku deployment using creat-react-app?
- Installing 'react-bootstrap' on a Gatsby Starter deployed on Netlify
- React Dashboard issue
- How to use logical or operator with multiple values?
- sass nesting doesn't work as I thought it did
- Displaying components from API in an efficient way
- How to implement autocomplete user search in React and Django Rest Framework
- How to update an array element in a mongoose db
- How set react-select width depending on biggest option width?
- Ideal place to put React Error Boundary component?
- Custom Input Field on datepicker
- React Hooks - How to get parameter value from query string
- store token in cookie or local storage in reactjs
- How to remove the start script error after executing 'npm start' for Reactjs App
- How to use Bootstrap npm package with React
- Gatsby: images added in MDX don't have blurring up effects when loading
- Detect when content overflow
- How can i animate the new posts coming from a snapshot in react.js
- File object with custom properties
- Redux store reset on route change on his own with nextJS