score:0
no, this is not possible. the whole idea of styled-components
is to return new components. and if you want to create classes you should have a look at glamor
or aphrodite
. and here is a link to a discussion on github.
score:0
if you want to customize an existing styled component, you can use the .extend()
api.
for example:
const button = styled.div`
background-color: red;
`;
const bluebutton = button.extend`
background-color: blue;
`;
export default () => (
<bluebutton />
);
Source: stackoverflow.com
Related Query
- Typescript with Styled component conditional css for custom props
- how to add custom css using react styled component
- Styled Component Custom CSS in ReactJS
- styled-component generate custom css class
- Import CSS File to Styled Component
- How to pass custom attribute to a styled component in a functional component?
- Adding active class with styled component not working
- Add styles to Styled Component custom Component in React Native
- Why custom css class does not work on React-Semantic-UI elements?
- How to get access to CSS values from a styled component (React)?
- How do I create css class in createMuiTheme() and use them directly without having to get its value from component "classes" props?
- Custom React Component Library not loading CSS when installed as dependency in another react project
- React Hook "useState" cannot be called in a class component. React Hooks must be called in a React function component or a custom React Hook function
- How to use function instead of class in Nextjs custom document for Styled Components?
- How to define a custom class to HighchartsReact component
- Combining "normal" css and custom css properties inline on a react component
- ReactJS Design Patterns - Class vs. Custom Component
- Adding custom CSS file into AdminBro component
- Dynamic className together with a fixed class name in a custom component
- what is the benefit of using styled components over using css class for the components
- Adding custom css to React-Bootstrap Component
- Is it possible to use a custom class name generator for styled components in MaterialUI?
- How to apply CSS style to custom React component
- Event triggered styled component css change
- Shared css declarations to styled component with props
- Target a css class in 'a component generated by library' in react
- Pass CSS class name to component with Next.JS
- Toggling a CSS class when a React.js component gets updated
- React - Using ternary to apply CSS class in functional component
- how to change the react component css class value
More Query from same tag
- How to transfer a value/object bottom to top in reactjs
- Using multiple modal forms in one component
- Why won't setMatrix([...matrix, [[x][y]]]) work?
- Uncaught TypeError: Cannot read property 'map' of undefined On Reactjs
- Animate between states
- Redux action return type when using dispatch and getState
- What is the Typescript type for a route map object in hookrouter?
- Add photo in object and show it
- React Redux Problem With Google Auth Sign In
- How to command+click to open url in new tab and switch to it in JavaScript?
- How to generate QR code together with the image in a center?
- How to fix an issue with non-opening navbar?
- React props comparison: "_.isEqual" versus "==="
- ESLint - how to disable react/forbid-foreign-prop-types?
- SetState in React ES6
- Positioning caret in contenteditable ReactJS components
- items shuffled during transition-out of usetransitions
- React data loading the previous state than what it is supposed to
- Fetching from API endpoint with React returns value undefined
- How to apply Styled Component styles to a custom React component?
- React Context API setState callback
- Iterate through nested data in Javascript
- Example of using arrow in Popper component of material-ui
- Using Spotify Web Playback SDK with React
- How to set proxy pass for react app on nginx?
- React forwardref current is always null
- onClick trigger click Error: current.click is not a function
- Complex nested components on React not working
- Reactjs is there a way to combine multiple protected routers?
- React JS. Append element to the DOM