Search
React usePrevious Hook
23.8.2021
Hooks are essential for the functional component pattern in React. One frequent logic comparison with class components was comparing a previous prop value with a current prop value via lifecycle methods. So what’s an easy pattern for duplicating previous value comparisons in functional...
Creating a Headless WordPress Site With Frontity
20.8.2021
Frontity is a WordPress-focused React-based server-side dynamic-rendering framework (phew!) that allows us to create fast headless websites. Chris has a good introduction to Frontity. I guess you could think of it like Next.js for WordPress. And while the demand …
The post Creating...
Three Buggy React Code Examples and How to Fix Them
5.8.2021
There’s usually more than one way to code a thing in React. And while it’s possible to create the same thing different ways, there may be one or two approaches that technically work “better” than others. I actually run into …
The post Three Buggy React Code Examples and How to Fix Them...
Demystifying styled-components
27.7.2021
 Joshua Comeau digs into how styled-components works by re-building the basics. A fun and useful journey.
styled-components seems like the biggest player in the CSS-in-React market. Despite being in that world, I haven’t yet been fully compelled by it. I’m …
The post...
Links on React and JavaScript
13.7.2021
As a day-job, React-using person, I like to stay abreast of interesting React news. As such, I save a healthy amount of links. Allow me to dump out my latest pile. Most of this is about React but not all …
The post Links on React and JavaScript appeared first on CSS-Tricks. You can support...
Fix Seeing “0” in Your JSX Code
9.7.2021
The early days of the web felt like the wild west when it came to coding practices — just make it work. Then we became enlightened to better practices, separating HTML from CSS and JavaScript. Then came React and JSX, where we combine JavaScript, HTML, and even CSS with Styled Components...
Hack the “Deploy to Netlify” Button Using Environment Variables to Make a Customizable Site Generator
1.7.2021
If you’re anything like me, you like being lazy shortcuts. The “Deploy to Netlify” button allows me to take this lovely feature of my personality and be productive with it.
Clicking the button above lets me (or you!) instantly …
The post Hack the “Deploy...
How to Cancel Pending API Requests to Show Correct Data
25.6.2021
I recently had to create a widget in React that fetches data from multiple API endpoints. As the user clicks around, new data is fetched and marshalled into the UI. But it caused some problems.
One problem quickly became evident: …
The post How to Cancel Pending API Requests to Show Correct...
Using Custom Elements in Svelte
22.6.2021
Svelte fully supports custom elements (e.g. <my-component>) without any custom configuration or wrapper components and has a perfect score on Custom Elements Everywhere. However, there are still a few quirks you need to watch out for, especially around …
The post Using Custom...
Svelte for the Experienced React Dev
21.5.2021
This post is an accelerated introduction to Svelte from the point of view of someone with solid experience with React. I’ll provide a quick introduction, and then shift focus to things like state management and DOM interoperability, among other things. …
The post Svelte for the Experienced...
A Love Letter to HTML & CSS
17.5.2021
I see you. In the back there, behind JavaScript and React and PHP and all those “real” programming languages, I see you. And I appreciate you.
The post A Love Letter to HTML & CSS appeared first on CSS-Tricks.
You can support CSS-Tricks by being an MVP Supporter
Workshop Efektivní vývoj v Reactu pro pokročilé
14.5.2021
Odteď už Vás React v ničem nepřekvapí. Nový workshop, díky kterému ovládnete React na maximum, je na světě! Pro příznivce Reactu jsme připravili praktický online workshop na téma „Efektivní vývoj v Reactu pro…
Comparing the New Generation of Build Tools
8.4.2021
A bunch of new developer tools have landed in the past year and they are biting at the heels of the tools that have dominated front-end development over the last few years, including webpack, Babel, Rollup, Parcel, create-react-app.
These new …
The post Comparing the New Generation of Build...
React Authentication & Access Control
1.4.2021
Authentication and access control are required for most applications, but they often distract us from building core features. In this article, I’ll cover a straightforward way to add auth and access control in React.
Instead of adding a static library …
The post React Authentication &...
Takes on State
24.3.2021
React is actually a bit of an outlier with state management. While it has first-class tools like useState and Context, you’re more own your own for reactive global state. Here’s David Ceddia with “React State Management Libraries and How …
The post Takes on State appeared...
How I Built my SaaS MVP With Fauna ($150 in revenue so far)
11.3.2021
Are you a beginner coder trying to implement to launch your MVP? I’ve just finished my MVP of ReviewBolt.com, a competitor analysis tool. And it’s built using React + Fauna + Next JS. It’s my first paid SaaS tool …
The post How I Built my SaaS MVP With Fauna ($150...
React authentication, simplified
4.3.2021
Authentication is one of those things that just always seems to take a lot more effort than we want it to. To set up auth, you have to re-research topics you haven’t thought about since the last time you did authentication, and the fast-paced nature of the space means things have often changed...
React Without Build Tools
3.3.2021
Jim Nielsen:
I think you’ll find it quite refreshing to use React A) with a JSX-like syntax, and B) without any kind of build tooling.
Refreshing indeed:
CodePen Embed Fallback
It’s not really the React that’s the hard part …
The post React Without Build Tools appeared first...
How We Improved the Accessibility of Our Single Page App Menu
25.2.2021
I recently started working on a Progressive Web App (PWA) for a client with my team. We’re using React with client-side routing via React Router, and one of the first elements that we made was the main menu. Menus …
The post How We Improved the Accessibility of Our Single Page App Menu...
React Component Tests for Humans
23.2.2021
React component tests should be interesting, straightforward, and easy for a human to build and maintain.
Yet, the current state of the testing library ecosystem is not sufficient to motivate developers to write consistent JavaScript tests for React components. Testing …
The post React...