Reactiflux

R

Reactiflux

Join the community to ask questions about Reactiflux and get answers from other members.

Join
Vvcarl11/22/2023

vcarl – 18-08 Nov 22

(hey folks, this channel is on the chopping block fyi. likely to be shut down in the immediate future. #help-react is best, we're considering other changes to help channels but don't have immediate plans atm)
PPoppingPopper10/18/2023

poppingpopper – 19-07 Oct 18

Hey! I'm trying to build a somewhat responsive page and I'm using a resize observer to get the width of the parent element to determine the width of my charts. For some reason the width changes in increments instead of immediately after the debounce interval I've set. Can you help me figure out why this is happening and how I might fix it? (Also open to constructive criticism about the way I'm approaching it as well)...
Solution:
if outmost div is flex, parent and charts will resize itself auto
Message Not Public
Sign In & Join Server To View
MMiguel10/8/2023

✅ – ✅ – landfight – 23-01 Oct 8

Hey everyone, when im creating components that are going to be reused in multiple pages, do i place the layout styling (padding, margin, etc.) on the page-level for each page or the component-level?
Solution:
hey, Both page-level and component-level styling have their advantages and may be suitable in different scenarios. Component-Level Styling: Reusability: Placing styling at the component level makes it easier to reuse the component across different pages or sections of your application. The component can maintain its appearance consistently regardless of where it's used. ...
Message Not Public
Sign In & Join Server To View
Ddmikester19/26/2023

✅ – ✅ – dmikester1 – 16-36 Sep 26

I have an OutsideClickTrigger hook I have found that I am utilizing to hide a filter menu whenever the user clicks outside the menu. There is a filters button that I am using to show the filters menu like this: onClick={() => setShowFilters(!showFilters)}. Now the issue is that when the filters menu is open, and I click on the filters button again to close it, it does not work or maybe it closes it quickly and then OutsideClickTrigger gets run and it shows it again. Last time I was able...
Solution:
But instead of using show/hide, you can just
{ showFilters ? <Comp/> : null }
{ showFilters ? <Comp/> : null }
...
Message Not Public
Sign In & Join Server To View
NNguyen9/16/2023

hoangvu12 – 15-33 Sep 16

I'm using NextJS 13 App dir, when I try to start the project, I got this error
Error: Catch-all must be the last part of the URL.
Error: Catch-all must be the last part of the URL.
I don't know why it cause that, I've seen some github issues and someone mentioned:...
KKuba9/2/2023

kuba_huba – 17-21 Sep 2

I was building a form today and I stumbled upon weird behavior. When I swapped buttons that were conditionally rendered, the event was firing when submit button was rendered. ```tsx <div className="mb-4"> <div className="flex gap-2"> <Button...
NNguyen8/29/2023

hoangvu12 – 05-14 Aug 29

I'm using NextJS v13 app router, I have following folder structure. I want to redirect the url from / to /[lng] (with data logic), but for some reason the middleware.ts is not triggered. Here is the code ```tsx...