FediScanner

#react

← Back

If you've worked with LaunchDarkly, the idea of Firebase Remote Config will probably feel familiar.

You've probably done this before:

if (featureFlags.newCheckout) {
// Show the new experience
} else {
// Keep the old experience
}

The beauty of feature flags is that you can deploy the code without necessarily exposing the feature to everyone.

You can turn something on.

Turn it off.

Roll it out gradually.

Experiment with it.

And, most importantly, you don't need to create a new deployment every time you want to flip a switch.

Firebase Remote Config follows a very similar idea.

But here's the interesting part:

It's not just about feature flags.

It lets you remotely control configuration and certain aspects of your web application's behavior.

Think of it as a remote control for your web app.

And yes, sometimes changing a true to a false really shouldn't require another deployment.

The problem we're trying to solve


Let's start with a very normal web development scenario.

You've built a new dashboard.

The feature is ready.

You deploy it to production.

Then the product manager says:

"Let's show this to only a few users first."


You think:

"No problem."


And then reality kicks in.

Change code
↓
Create PR
↓
Code review
↓
CI
↓
Build
↓
Deploy
↓
Verify

Or maybe you already have the flag in your code:

const newDashboard = false;

Now you need to change:

const newDashboard = true;

Same ceremony.

Different boolean.

This is where remote configuration becomes useful.

What is Firebase Remote Config?


At a very basic level, Firebase Remote Config allows you to define parameters remotely and let your application consume those values.

For example:

new_dashboard = true

Your web application reads the value and decides what to do.

The application code might look like:

if (newDashboardEnabled) {
renderNewDashboard();
} else {
renderOldDashboard();
}

The code doesn't change.

The configuration does.

That's the fundamental idea.

Your code defines what the application can do. Remote Config helps decide how it behaves.


If you've used LaunchDarkly, this should sound familiar


This is where my previous experience with feature flagging helped me understand Remote Config quickly.

With a feature flagging platform such as LaunchDarkly, the mental model is something like:

Application
↓
Ask for flag
↓
Flag service
↓
ON / OFF / variation
↓
Application decides what to show

Remote Config has a very similar flow:

Web Application
↓
Fetch configuration
↓
Firebase Remote Config
↓
Parameter value
↓
Application uses the value

So if you've worked with feature flags before, you're already halfway there.

The difference is that Remote Config is broader than just feature flags.

You can use it for things like:

feature_enabled = true

max_results = 20

show_beta_banner = false

search_mode = "new"

ai_prompt_version = "v2"

Feature flags are one use case.

Remote configuration is the bigger idea.

Feature flags are basically switches


Let's take the simplest example.

You have a new checkout experience.

Your code:

if (newCheckoutEnabled) {
showNewCheckout();
} else {
showOldCheckout();
}

Remote Config:

new_checkout = false

The old checkout appears.

Change the configuration:

new_checkout = true

The new checkout appears.

No code change.

No new build.

No deployment.

It's essentially a remote switch.

Remote Config
|
new_checkout
|
┌──────┴──────┐
↓ ↓
true false
↓ ↓
New checkout Old checkout

Simple.

But this simple idea unlocks quite a few interesting possibilities.

Deploying code and releasing a feature are different things


This is probably my favorite concept here.

Traditionally, we tend to think:

Deploy = Release

But feature flags and remote configuration allow us to separate them.

You can do:

Deploy code
↓
Feature OFF
↓
Test in production
↓
Enable for selected users
↓
Monitor
↓
Increase rollout

So:

You can deploy a capability without immediately exposing that capability to everyone.


That's a powerful change in release strategy.

Gradual rollouts


Let's say you're introducing a new search experience.

You could release it to everyone:

100% → New Search

Or you could gradually expose it:

5%
↓
10%
↓
25%
↓
50%
↓
100%

At every stage, you can watch:

  • errors
  • performance
  • conversion
  • engagement
  • user feedback

If something looks wrong at 10%, you don't necessarily need to roll back the entire deployment.

You can change the configuration and reduce exposure.

This is especially useful when the feature is:

  • new
  • risky
  • performance-sensitive
  • used by a large number of users
  • difficult to test completely before production

Production becomes less of a big bang and more of a controlled experiment.

"But how do I choose who gets it?"


This is where feature flags become more interesting than a simple ON/OFF switch.

You may want:

new_dashboard = true

for one group of users and:

new_dashboard = false

for everyone else.

You might target based on available Firebase conditions and application context.

Conceptually:

Users
|
┌────────┴────────┐
↓ ↓
Selected users Everyone else
↓ ↓
New dashboard Old dashboard

Now you're not just asking:

"Is the feature enabled?"


You're asking:

"For whom is the feature enabled?"


That's where remote configuration becomes a proper release-management tool.

Remote Config + experimentation


Now let's make things a little more interesting.

Imagine you're building an e-commerce website.

You have two versions of a CTA:

Version A


Start Free Trial

Version B


Try It Free

Which one performs better?

Instead of continuously changing the frontend code and deploying every experiment, configuration can control which variation is presented.

Conceptually:

Users
|
┌──────┴──────┐
↓ ↓
Group A Group B
↓ ↓
Version A Version B

Then you measure the results.

That's where Remote Config and experimentation start working together.

You're not just changing configuration.

You're using configuration to learn from real users.

This gets even more interesting with AI


AI-powered web applications make remote configuration particularly interesting.

Why?

Because AI applications often have parameters that change frequently.

For example:

prompt
model
response length
thresholds
fallback behavior
UI behavior

Imagine an AI assistant on your website.

Your first prompt might be:

Summarize the user's question.

You want to try:

Summarize the user's question in three concise bullet points.

Instead of hardcoding every variation and deploying for every small change, you can use remotely managed configuration where appropriate.

You could experiment with:

Group A → Prompt A
Group B → Prompt B

Then observe things like:

  • completion rate
  • engagement
  • user feedback
  • conversion
  • response quality

The important idea isn't that Remote Config magically makes AI better.

It gives you more control over how you introduce and experiment with changes.

And when AI behavior is involved, that control becomes even more valuable.

Real-time changes


Firebase Remote Config also supports real-time configuration updates.

Here's the basic idea.

Suppose you've changed a configuration parameter.

Instead of waiting for a traditional release cycle, the client can be notified that the Remote Config values have changed and can fetch and activate the latest configuration according to the application's implementation.

Conceptually:

Firebase
|
Configuration changed
|
↓
Client notified
|
↓
Fetch latest values
|
↓
Activate
|
↓
Application reacts

For a web application, this can be useful when you need configuration changes to reach active clients faster.

But there's an important engineering detail:

Real-time does not mean "ignore caching, fetching, activation, or application state."

Your application still needs to implement the behavior correctly.

Remote Config isn't a magic wand


There's one thing we need to be very clear about.

Remote Config cannot create new functionality.

You can't write:

build_new_payment_system = true

and expect Firebase to build your payment system.

Nice thought, though.

Your application needs to already contain the functionality.

For example:

if (paymentV2Enabled) {
usePaymentV2();
}

The code needs to exist.

Remote Config simply controls whether that path is used.

Think:

Application code
+
Configuration
=
Application behavior

Not:

Configuration
↓
Generate application

What happens when Remote Config isn't available?


This is where good engineering comes in.

What if the user's internet connection is terrible?

What if the configuration can't be fetched?

What if Firebase isn't reachable?

Your application should still know what to do.

That's why you should define sensible defaults.

For example:

const defaults = {
newDashboard: false
};

Now the flow becomes:

Fetch Remote Config
|
┌──────┴──────┐
↓ ↓
Success Failure
↓ ↓
Remote value Default value

The remote configuration is the override.

The default is the safety net.

And your application should choose defaults that fail safely.

Remote Config isn't your database


Another common question is:

"Why not just store this in Firestore?"


Because configuration and application data are different things.

Think about it this way.

Firestore


What does my application know?

users
orders
products
messages

Remote Config


How should my application behave?

new_dashboard = true
max_results = 20
beta_banner = false

Secret Manager


What must remain secret?

API credentials
private keys
secrets

A simple mental model:

Firestore
↓
Application DATA

Remote Config
↓
Application BEHAVIOUR

Secret Manager
↓
Application SECRETS

And please don't put passwords into Remote Config because:

"Well... it's remote."


Remote does not mean secret.

Don't make everything configurable


There's another trap waiting for us.

Once you discover Remote Config, everything suddenly looks like a candidate.

button_color
button_padding
button_radius
font_size
animation_speed
header_height
show_logo
random_flag_1
random_flag_2
random_flag_3

And congratulations.

You've just created a second codebase.

Remote Config should be used where changing a value remotely provides meaningful value.

Good candidates might include:

feature flags
rollout controls
experiment parameters
limits
behavior switches
maintenance controls
AI-related configuration

But if something never needs to change independently of a deployment, keeping it in code may be perfectly fine.

Configurable doesn't automatically mean better.

Where Remote Config fits in a web architecture


A simplified architecture might look like this:

Web Application
|
┌─────────┴─────────┐
| |
Code Remote Config
| |
"What can it do?" "How should it behave?"
| |
└─────────┬─────────┘
↓
User Experience

The application owns the logic.

Remote Config provides configuration.

The browser combines the two.

Remote Config vs LaunchDarkly


Since LaunchDarkly is a familiar name for many developers, here's the simplest way I'd describe the relationship.

They overlap heavily around:

  • feature flags
  • targeting
  • gradual rollouts
  • experimentation
  • runtime control

But their positioning is different.

LaunchDarkly is primarily a dedicated feature-management platform.

Firebase Remote Config is a Firebase service focused on remote application configuration, with feature flags and experimentation as important use cases.

So I wouldn't think of Remote Config as:

"LaunchDarkly, but from Google."


I'd think:

"Remote configuration with feature-management capabilities, integrated into the Firebase ecosystem."


That distinction makes the product easier to understand.

Why this matters for modern web applications


Web applications are no longer static pages that we deploy once and forget.

We're constantly changing:

  • UI
  • experiments
  • feature availability
  • performance settings
  • user experiences
  • AI behavior
  • product flows

And every change doesn't necessarily deserve another deployment.

Sometimes you simply need control.

Remote Config provides a mechanism for that control.

The bigger shift


For me, Remote Config represents a broader change in how we think about software delivery.

Old mindset:

Build
↓
Deploy
↓
Everyone gets it

New mindset:

Build
↓
Deploy
↓
Control exposure
↓
Observe
↓
Learn
↓
Gradually roll out

That distinction is especially valuable when you don't know exactly how a change will behave in the real world.

And let's be honest:

we rarely do.

You can have:

  • unit tests
  • integration tests
  • E2E tests
  • QA environments
  • staging environments
  • performance testing

And production will still find a way to surprise you.

Production has a PhD in that.

Final takeaway


Firebase Remote Config may look like a simple key-value store.

But the interesting part isn't the key-value pair.

It's the control it gives you after deployment.

You can:

  • toggle features
  • target users
  • run experiments
  • gradually roll out functionality
  • change configuration remotely
  • react to feedback faster
  • manage certain AI-related behavior
  • reduce the blast radius of risky releases

And the idea I'd take away is this:

Deploy the capability. Control the exposure.


Your code doesn't have to change every time your product decision changes.

Sometimes the code is perfectly fine.

You just need to flip the switch.

And that's when having a remote control for your web application starts making a lot of sense.

One last mental model


Your Web App
|
┌────────┴────────┐
↓ ↓
Code Remote Config
↓ ↓
"What can it do?" "How should it behave?"
| |
└────────┬────────┘
↓
User Experience

Ship the code.

Control the experience.

And maybe save yourself one more deployment for a tiny configuration change.#gcp #firebase #javascript #react #software #coding #development #engineering #inclusive #community
Firebase Remote Config for Web Apps: Your App’s Remote Control

Show Original PostReport

What Actually Happens When State Changes in React?


When state changes, many developers think:

setState() → React updates the DOM

That's a useful simplified model, but there's more happening in between.

A better mental model is:

State / Props change
↓
React schedules a render
↓
Component runs again
↓
React reconciles the new tree
↓
React commits the required DOM changes

1. State or props change


For example:

const [count, setCount] = useState(0);

setCount(count + 1);

The state update tells React that the component needs to be rendered again.

2. The component runs again


React calls the component function again using the new state:

function Counter() {
const [count, setCount] = useState(0);

return <button>{count}</button>;
}

This is what we commonly call a re-render.

3. React creates the new element tree


The component produces a new React element tree based on the current state and props.

React now has:

Previous tree
↓
New tree

It needs to determine what actually changed.

4. React reconciles the trees


React compares the new result with the previous one.

For example:

Before: <button>0</button>
After: <button>1</button>

React doesn't need to recreate the entire DOM.

It determines the necessary update.

5. React commits the changes


After React determines what needs to change, it commits those changes to the actual DOM.

So remember:

A re-render does NOT mean the entire DOM is recreated.


This distinction is important when thinking about React performance.

A component rendering again isn't automatically a performance problem.

Instead, ask:

Did this render produce unnecessary work?


That's where tools such as React DevTools Profiler become useful. They can help you identify expensive or unnecessary rendering before you start adding optimizations.

The mental model


Keep this simple flow in mind:

Update
↓
Render
↓
Reconcile
↓
Commit

Understanding this flow makes React performance optimization much easier to reason about.

Before reaching for useMemo, useCallback, or React.memo, understand what is actually causing the work.

Profile first. Optimize second.#react #frontend #javascript #webdev #software #coding #development #engineering #inclusive #community
🔥 30 Days of Frontend - Day 1

Show Original PostReport

React as a JavaScript Library


React is a JavaScript library mainly used for building user interfaces. A library provides reusable code that we can use whenever we need it. The main difference between a library and a framework is control. In a library, we call the library when we need it, but in a framework, the framework provides the overall structure and controls the flow of the application.

For example, Axios is a library used for making HTTP requests. We decide when to call it:

axios.get("https://example.com/users");

A real-world example is a toolbox. We take a particular tool whenever we need it. A framework is more like a construction company that follows a predefined process and structure for building a house.

React and Single Page Applications


React is commonly used to build Single Page Applications (SPA). In a traditional website, clicking a link can request a new HTML page from the server and reload the browser page. In a React SPA, different parts of the UI can be updated without requiring a full browser page reload.

For example, in an online shopping application, when the user adds a product to the cart, React can update the cart count without refreshing the complete page. This makes the application feel more like a desktop or mobile application.

React Components


A component is a reusable building block of a React application's UI. Instead of creating the complete website in one large file, we can divide it into smaller components such as Navbar, ProductCard, Sidebar and Footer.

function Welcome() {
return <h1>Welcome to my website</h1>;
}

function App() {
return (
<div>
<Welcome />
</div>
);
}

Here, Welcome is a component. We can reuse it wherever we need it.

Components are useful because the same UI structure can be reused with different data. For example, a ProductCard component can be used for many different products.

JSX Expressions


JSX allows us to write HTML-like code inside JavaScript. A JSX expression is JavaScript code written inside curly braces {}.

function App() {
let name = "Abimanyu";

return <h1>Hello {name}</h1>;
}

Here {name} is a JSX expression. React evaluates the JavaScript expression and displays its value.

We can also use calculations and conditions:

function App() {
let a = 10;
let b = 20;

return (
<div>
<h1>{a + b}</h1>
<p>{a > b ? "A is bigger" : "B is bigger"}</p>
</div>
);
}

Expressions produce values, so they can be used inside JSX. Statements such as normal if statements cannot be directly placed inside JSX. A ternary operator can be used when a condition needs to produce a value.

Rendering in React


Rendering means React takes a component and creates or updates the UI displayed in the browser.

For example:

function App() {
return <h1>Hello World</h1>;
}

React renders this component and the browser displays Hello World.

In a modern React application, we commonly use createRoot():

import { createRoot } from "react-dom/client";
import App from "./App";

createRoot(document.getElementById("root")).render(
<App />
);

The .render() method tells React which component should be displayed inside the root DOM element.

When the state of a component changes, React renders the component again and determines which parts of the UI need to be updated.

Props


Props, short for properties, are used to pass data from a parent component to a child component.

function Student(props) {
return <h2>Name: {props.name}</h2>;
}

function App() {
return (
<Student name="Abimanyu" />
);
}

Here, name="Abimanyu" is a prop passed from App to Student.

Props are similar to arguments passed to a JavaScript function:

function student(name) {
console.log(name);
}

student("Abimanyu");

In React, we can pass different types of data through props, such as strings, numbers, arrays, objects and even functions.

Props Destructuring


Instead of accessing every value through props, we can use JavaScript destructuring.

Without destructuring:

function Student(props) {
return (
<div>
<h2>{props.name}</h2>
<p>{props.age}</p>
</div>
);
}

With destructuring:

function Student({ name, age }) {
return (
<div>
<h2>{name}</h2>
<p>{age}</p>
</div>
);
}

Both examples work in the same way. Destructuring simply makes the code shorter and easier to read.

Props Children


children is a special prop in React. It contains the content placed between the opening and closing tags of a component.

For example:

function Box(props) {
return <div>{props.children}</div>;
}

function App() {
return (
<Box>
<h1>Hello</h1>
<p>Welcome to my website</p>
</Box>
);
}

The content inside <Box>...</Box> becomes props.children.

We can also destructure children:

function Box({ children }) {
return (
<div className="box">
{children}
</div>
);
}

This is useful when creating reusable components such as cards, boxes, buttons, layouts and modal components.

For example:

function Card({ title, children }) {
return (
<div className="card">
<h2>{title}</h2>
{children}
</div>
);
}

We can use the same component with different content:

<Card title="Profile">
<p>Name: Abimanyu</p>
<p>Age: 21</p>
</Card>

<Card title="Contact">
<p>Email: example@gmail.com</p>
<button>Contact Me</button>
</Card>

Here, title is a normal prop, while children contains the content written inside the Card component.#react #webdev #programming #javascript #software #coding #development #engineering #inclusive #community
React Basics: Library, SPA, Rendering, Components, JSX and Props.

Show Original PostReport

React is a JavaScript library for creating the Graphical User Interface (GUI) of web applications. It is used specifically for creating mobile application and single page web applications. The code structure in React is constructed in the form of components and class components. The functionality of React employs the Document Object Model (DOM), Virtual DOM, JSX (JavaScript XML), and a number of Lifecycle methods like 'render', 'shouldComponentUpdate', 'componentWillUnmount'.

Features of React


1.JSX

JSX or JavaScript XML, is an extension of the JavaScript language syntax. It allows developers to render components with syntax close to HTML. Even though React components can be constructed using pure JavaScript, JSX is employed because it is simple and simple to read. Babel is pre-processor that transforms HTML-like syntax in JavaScript files into normal JavaScript objects. This incorporation of HTML in JavaScript makes the code easier to read, enhances the performance of JavaScript, and assists in making the overall application more stable.

2.Virtual Document Object Model

React employs an in-memory data structure cache to calculate the difference between the old and new states of the DOM. It re-renders only the required changes rather than re-rendering the entire application. This selective updating process enhances speed and performance to great extent and decreases memory usage.

3.One-Way Data Binding

This feature enables a unidirectional flow of data. This type of mechanism enables more control over the application as the state is stored in specific stores, and other components can remain loosely couple. This structure enables the application to be more flexible and efficient.

4.Testability

In React, views are representation of the state, which dictates the behavior of the component. Therefore, changes can be introduced to the state, which passed to a ReactJS view in order to as certain the resulting output, actions, functions, and events. This simplifies the process of testing and debugging.#frontend #javascript #react #webdev #software #coding #development #engineering #inclusive #community
React and its features

Show Original PostReport

Affirm is hiring Senior Software Engineer, Mobile (Repayment UX)

🔧 #javascript #typescript #react #reactnative #seniorengineer
🌎 Remote; Poland
⏰ Full-time
🏢 Affirm

Job details jobsfordevelopers.com/jobs/sen
#jobalert #jobsearch #hiring

Show Original PostReport

I used to think fetching API data in React was pretty straightforward.

Fetch the data → put it in useState → render it.
And for a small application, it works perfectly fine.

const [users, setUsers] = useState([]);

useEffect(() => {
fetch("/api/users")
.then(res => res.json())
.then(data => setUsers(data));
}, []);

The problem starts when the application grows.

Suddenly, you need to handle:

Loading states
Errors
Refetching
Caching
Stale data
Retries
Multiple components using the same data
Keeping server data in sync

At that point, the question isn't really, "Can I use useState?"
Of course I can.

The better question is:

Who owns this state?
Client State vs Server State :

Client state is state owned by the UI.

Things like:

Is a modal open?
Which tab is selected?
What's currently typed in an input?
Which item is selected?

For example:

const [isModalOpen, setIsModalOpen] = useState(false);
const [selectedTab, setSelectedTab] = useState("profile");

useState is a great fit here because the component is responsible for that state.

Server state is different.

Think about:

Users
Products
Orders
Notifications
Comments
Dashboard data

This data comes from an external source.

Your React application is essentially consuming a snapshot of data that the server owns.
That means the data can change outside your component.
It can become stale, need to be refetched, or be shared across multiple components. You may also want caching and background updates.
That's where something like TanStack Query becomes useful.

Instead of manually managing:

const [users, setUsers] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);

you can let a server-state library handle much of that lifecycle:

const {
data: users = [],
isLoading,
error
} = useQuery({
queryKey: ["users"],
queryFn: getUsers
});

Now the responsibility isn't just "store this API response in state."
You're working with data that has a lifecycle:

fetch → cache → become stale → refetch → update

That's the part that useState doesn't try to solve.

So, should we stop using useState?
Definitely not.

I still use useState for UI state all the time.
The lesson is simply that not all state is the same.

A useful mental model is:

UI owns it → useState
Server owns it → consider a server-state solution

Once I started thinking about state this way, React state management became much easier to reason about.
It's not about replacing useState.
It's about using the right abstraction for the problem you're actually solving.

Have you had a similar experience where a simple useState + useEffect solution eventually became difficult to maintain?#javascript #react #frontend #webdev #software #coding #development #engineering #inclusive #community
React State vs Server State: Why You Shouldn't Store Everything in useState

Show Original PostReport