Questions tagged [styled-components]
styled-components is a JavaScript library for styling React applications. It removes the mapping between styles and components, and lets you write actual CSS augmented with JavaScript.
styled-components
4,608
questions
0
votes
0
answers
21
views
How do I resolve styled_components__WEBPACK_IMPORTED_MODULE_2__.div is not a function?
I am trying to create a custom styled component using react native, here is my code for the styled component, but when i run yarn dev, i seem to get this error
import React from 'react';
import styled ...
0
votes
0
answers
10
views
React Modal Transition working on exit, but not on entrance
I created a custom Modal component in React for creating popup modal dialogs. I am using react-transition-group to try and "zoom-in" the modal when it first shows up and "zoom-out" ...
0
votes
0
answers
12
views
how to style images in styled-components
these are my images in my React.js app:
<img className="mobile-image" src={MobileImage} alt="mobile image" />
<img className="desktop-image" src={DesktopImage} ...
0
votes
0
answers
10
views
Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/image-web-3-mobile.aff7026b3651.jpg') is not a valid name [closed]
im trying to import an image from src folder
import MobileImage from "../../assets/images/image-web-3-mobile.jpg";
i get an error on my screen Failed to execute 'createElement' on 'Document':...
-2
votes
0
answers
32
views
styled components vs tailwind
Heard about some performance issues with styled components, so created some jsperf test compare it with tailwind css, but results almost the same, what I'm doing wrong in test:
https://jsperf.app/...
0
votes
0
answers
18
views
React application not correctly "pathing" my image
I have a React application created using Vite. I am also using Styled Components. Everything works fine, except when I specify my background image, it is not creating a correct path.
As you can see, ...
0
votes
2
answers
59
views
Styled Components styles are not applied
I've a react popup which uses styled-component for styling. I'm rendering the react app in shadow dom. Because I didn't want any other css file to modify the popup. It is working on most sites except ...
0
votes
0
answers
11
views
Styled Components overlay blocks form element on iPad only
I was developing a login/signup page using a template or code done using styled-components library online; however, the strange thing is this works for all my devices, at also at different screen ...
0
votes
1
answer
37
views
Make left column of table sticky using React Styled Components
Using styled components, I have created the following styled elements. My objective is to make the first row and column "sticky", so when the user scrolls through the table they always ...
0
votes
0
answers
18
views
How to make a section sticky with links react-intersection-observer
I've experimented a bit with react-intersection-observer but I'm quite new at it and doesn't seem to grasp how to make the stickyness smooth in mobile.
I have a sticky section containing a couple of ...
0
votes
0
answers
37
views
NextJS Optimizing Pagespeed TBT Mobile
I have my NextJS+TS (App Router) + Styled Components app in production with Vercel+Cloudflare, and I'm seeing good results (95+) on all metrics on desktop when using https://pagespeed.web.dev/. But on ...
0
votes
1
answer
39
views
How to change the styling of FloatButton from AntDesign?
I am trying to customize my FloatButton component some custom CSS and can't find out how to do it for the background color and for the Icon that is displayed in it. I tested with this code but it ...
0
votes
0
answers
33
views
The getStyleElement() method of ServerStyleSheet returns an empty style
Question
We upgraded our Yarn version from 1.22.19 to 4.3.0 and TypeScript from 4.8.4 to 5.4.5, while keeping the styled-components version unchanged and updating other modules.
Since this upgrade, ...
0
votes
1
answer
34
views
How can I set a custom header for a MUI DateCalendar in order to make it collapsable?
I'm trying to customize the MUI's DateCalendar component, expecting to add a new iconbutton in it's header, that may collapse its content when clicking it.
Such as this:
I managed to do everything, ...
0
votes
0
answers
19
views
react-native App with Expo crashes only in iOS
This RN Component:
import { getRandomColor } from '@shared/lib/helpers'
import { AvatarContainer, InitialText } from './styles'
export const InitialAvatar = ({ name }) => {
const ...