React

1088 readers
1 users here now

A community for discussing anything related to the React UI framework and it's ecosystem.

https://react.dev/

Wormhole

[email protected]

Icon base by Skoll under CC BY 3.0 with modifications to add a gradient

founded 2 years ago
MODERATORS
1
2
5
submitted 4 weeks ago by zamithal to c/react
 
 

I'm looking to write an HOC that counts and prints to the console the number of elements in the wrapped component. For example:

const Foo: FC<{}> = ({}) => {
    return (
        <div>
            <h1>Foo</h1>
            <p>Bar</p>
        </div>
    )
}


export default countH1(Foo)

this should print 1 and then return Foo as is for rendering.

React.Children.forEach(child => {...})

seems to be about the explicit children property and not descendant html elements. How can I achieve this?

3
 
 

First off, I've been loving vanilla-extract for the past 10 months. 😊

The only thing I really missed was the ability to sort CSS properties. Since there wasn't an ESLint plugin for that, I decided to create my own.

@antebudimir/eslint-plugin-vanilla-extract offers CSS property ordering (alphabetical, concentric, and custom), auto-fix capabilities, and supports multiple Vanilla Extract APIs.

If anyone wants to give it a shot, you can find more details in the readme. Looking forward to hearing your feedback.

4
5
10
React v19 (react.dev)
submitted 4 months ago by [email protected] to c/react
6
7
3
Chakra UI: Announcing v3 (www.chakra-ui.com)
submitted 5 months ago by [email protected] to c/react
8
9
 
 
10
4
submitted 7 months ago* (last edited 7 months ago) by cosmicbytes to c/react
 
 

Hi all,

This is my first time posting my blog, I hope you enjoy it!

11
12
13
8
State of React 2023 survey results (2023.stateofreact.com)
submitted 8 months ago by [email protected] to c/react
14
 
 

The article mentions Next.js but it also applies to vanilla React as the sizes attribute is useful even outside Next's <Image> component.

15
16
10
submitted 10 months ago by [email protected] to c/react
17
 
 

Hi there,

I have written an article on implementing server-side caching that ensures your app stays fast as you scale.

I’ve used ExpressJS for the API server, and React for the frontend.

Hope this helps someone!

18
5
submitted 11 months ago* (last edited 11 months ago) by [email protected] to c/react
 
 

I stumbled upon this project on GitHub and figured it might be of interest to some people here

19
11
submitted 1 year ago by starman to c/react
20
-2
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/react
21
 
 

I have a custom hook that I'm working on to make a fetch request to an api, and it is causing infinite re-renders. I'm struggling a bit to understand how the various parts of my application fit together -- in particular, my store (zustand) is using a middleware (immer) for immutable state, and I'm not certain why its drafting system isn't protecting me from changes in object identity. What tools can I use to try to track down what I've gotten wrong? I can't really leave the web page open very long because I'm making 1000s of requests per minute to the api I'm working against, so the Chrome dev tools are out, and the static analysis tools I set up (typescript and eslint) haven't identified any errors, like missing a dependency from the useEffect hook dependency array.

22
23
24
 
 

Firereact is hooks, component and utilities library for Firebase and React.

Features

  • Very lightweight, unpacked size when unpacked, npm min bundle size when minified, npm minzip bundle size when minified+gzipped
  • Supports Auth, Firestore, Functions, Providers and Storage.
  • Provides hooks such as useUser for Auth or useDocument for Firestore, which can listen to realtime changes as well
  • Provides custom components such as <FirestoreDocument /> or <StorageDownloadLink /> to keep the logic simple and/or avoid unnecessary rerendering
  • Provides Providers such as FirebaseSuiteProvider, FirebaseAuthProvider or FirestoreProvider to access Firebase service instances anywhere in the component tree without relying on global variables or prop-drilling
  • Comprehensive documentation
25
view more: next ›