Our Own React Global State Manager in Less Than 50 Lines of Code

This ad is not shown to multipass and full ticket holders
React Summit US
React Summit US 2025
November 18 - 21, 2025
New York, US & Online
The biggest React conference in the US
Learn More
In partnership with Focus Reactive
Upcoming event
React Summit US 2025
React Summit US 2025
November 18 - 21, 2025. New York, US & Online
Learn more
Bookmark
Rate this content

FAQ

You can create a global state manager in React using React context in under 50 lines of code. This approach is dependency-free and has minimal transfer size. However, it may have performance issues with renders and is tied to React, making stores React-specific.

Redux Saga is a tool for managing side effects in Redux applications. While it offers powerful capabilities, it can become complex and time-consuming to manage, potentially leading to late nights debugging or implementing features.

Alternatives to Redux for state management in React apps include React context, Zustand, and custom hooks. These solutions can offer simpler implementations with fewer dependencies or boilerplate, and they are not necessarily tied to React.

The proposed global state manager is implemented in a simple and lightweight manner using hooks and vanilla JavaScript. It avoids the complexity and boilerplate associated with Redux, and does not rely on context or providers.

useSyncExternalStore is a React hook that allows you to subscribe to external state changes. It is used to manage global state by subscribing to changes and updating components accordingly without relying on context or providers.

Zustand is favored for its simplicity, ease of use, and the fact that it is not tied strictly to React, allowing flexibility in how it is used across JavaScript applications. It also provides a clear API and efficient state management.

Performance can be optimized by using selectors to subscribe only to specific parts of the state that components need, thus reducing unnecessary re-renders.

Yes, it is possible to use a custom hook for state management without providers in React by using vanilla JavaScript and the useSyncExternalStore hook, which allows components to subscribe to external state changes directly.

The 50-line global state manager solution may lack features such as deep checking of object differences and debugging tools. It is also not a production-ready solution, but rather a simple demonstration of managing state with minimal code.

Creating a custom global state manager provides a lightweight and flexible solution tailored to specific needs, with minimal dependencies and boilerplate, while offering a deeper understanding of state management principles.

Miguel Ángel Durán
Miguel Ángel Durán
26 min
13 Jun, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Speaker delves into global state management in React, mentioning Redux and alternatives like React context. Creating a global state manager in under 50 lines of code with React context, highlighting challenges with performance and React specificity. Building a custom hook named user store for state management, implementing state and API for store, handling partial state updates efficiently. Managing listeners for state changes, setting up custom hooks and selectors, and subscribing to external stores. Demonstrating optimization in state management and preventing unnecessary button re-renders. Discussion on Redux, Signals, debugging, and various global state management choices like Zestand and Redux toolkit.

1. Introduction to Global State Management in React

Short description:

Speaker initiates a discussion on global state management in React, mentioning Redux and alternatives like React context.

Hi, everyone. Hi. Hello. Before we dive in, I'd like to get to know you a little. Let's do a quick hands-up survey, okay? Please raise your hand if you are using a global state manager in your React app. Okay. Thank you.

Now, please raise your hand if you prefer Angular instead of React. Okay. Now, please. No worries. No judgment here. So, can anyone recognize this logo? Yes. It's Redux. Have you tried it? Yeah? But have you suffered it?

Redux Saga is probably the tool that has stolen the most hours of sleep from me. It's hours and hours. Because Redux at the beginning felt great, fast, powerful. And then as the project grows, and don't get me wrong, I love Redux for many years. I like Redux Toolkit even more. I'm grateful for everything it has brought to the ecosystem. And today we have plenty of choices. The ecosystem is rich. So, I'm happy for it. But the question is, how we could create our own global state manager? Option one, React context. Option two, installing more dependencies. Three, just use Redux for God's sake. Or with CSS. Now that CSS is evolving fast, who knows? Let's ask Chagipity.

2. Approach to Global State Management Efficiency

Short description:

How to create a global state manager for React in under 50 lines of code using React context. Challenges with performance and React specificity. Ending with humor about AI's responses.

So, how to create a global state manager for React in under 50 lines of code? And as expected, and I'm pretty sure that most of you thought the same, it replies with a React context example. I even use my prompt engineering skills to get the best answer, as you can see.

So, let's mark React context. Thanks, Chagipity, for putting more React to React. And yes, it works. It's fine. It's less than 50 lines, dependency-free, almost no transfer size, and by code, which is great. But we start having performance problems with renders, which it would be solved by this hook that lets you subscribe only to the part of the context that you need. is only a draft for now. A draft, still waiting for resolution since 2019.

Yeah. And I think we will have to keep waiting even longer. So, don't wait for it. Another problem is that it's tied to React. So, our stores are going to be React specific. And the talk would end right now. So, that would be the end. So, yes, that's the end. Thanks. Use the AI. Problem solved. Thanks for coming. Bye. No, no, no. Thanks. Thanks, Sam Alman. Thanks for that. I'm joking. This is the problem with AI. You do ask for a tasty meal and it gives you something that seems to be right.

3. Creating Custom Hook for State Management

Short description:

Building a global estate manager for React in 50 lines of code from scratch without context, providers, or estate. Using the create function to create a custom hook named user store for state management based on hooks.

That's the problem with the prompts. When you expected some beef with a cold brew. Yeah. The thing is that we don't want AI to take our jobs yet, but still we expect it to do all the work for us. It's weird. But not today. Today let's build a global estate manager for React in 50 lines of code from scratch with no context, no providers, and no estate.

I'm Miguel Angel Duran. I'm a Spanish content creator and I'm on every social network that will let me to be even blue sky. I'm midudev everywhere, but on Instagram you'll see that it's not me. Okay? I don't know if he's also a developer, but you can find me there as midudev. Do you know this bird? Yes. This is state management solution based on hooks. Who is using this right now? A lot of people. Great. So, this is how it works. We use the create function to build a custom hook called user store. Inside that call we set the initial state and define actions that update the state using the set method. Then in any component, we could read and update the counter. No context, no providers, just one hook. That's all that you need for having a global estate manager.

It's simple, fast, easy, only one dependency, no boilerplate. It isn't tied to React because you could use the store anywhere else because it's vanilla JavaScript. But it has a problem. We didn't build it ourself. And any advanced technology looks like magic when you don't know how it works. So, to understand it, we're going to create it from scratch. So, let's bytecode. One thing, be gentle, live coding could be wrong. Okay? So, I'm going to try to program with that distance.

4. Implementing State and API for Store

Short description:

Creating a store with a counter component to read and update the value of the counter. Implementing the basic structure of the state and API for creating and updating the state.

So, okay. We have here the editor. I have a project that we have a bunch of tests already. I'm using Vann. I hope that Jared is happy. I'm using Vann. As you can see, I have plenty of errors right now. And the way I'm using this is I'm creating the store. Like Houston, we have a counter, I'm sorry, is a typical example. And we have different ways to update this estate. As well, we are using this store with the custom hook, this useCounterStore. Are you able to see the, should I zoom in or something? No? It's fine? Okay. So, we have in the counter component, we are using this counter store to read the value of the counter and even to update the counter in different ways.

What's the problem right now? The problem is that this is not working. This is not working because the code to do this, it's empty. So, the first thing that we are going to do is to implement the part of vanilla. The first thing that we need is to create the state and creating a way to get the state. Now that we have the state that is the most basic thing, we need to return this API. So, anyone that want to create a store is going to be able to use it. So, you would create the API with the getState for now only. And we have to create, we have to update the state.

We are going to update the state using the createdState. The createdState is the parameter where we are receiving that is going to explain the store how it has to create the state. So, when we are creating the state, we should pass how to update the state which we don't have yet, how to get the state, and all the API with all the methods. And finally, we are going to return the API. If everything is working as expected, we could see that at least one test is passing. The test that is passing is this one. This one of we create a store with an initial state and we just get the state and it's the same that we are creating from the beginning. That's the easy part.

5. Retrieving Initial State and Updating State

Short description:

Creating getInitialState method to retrieve the initial state and introducing setState method to update the state efficiently.

That's the easy part. Now, we need to be able to get the initial state because sometimes, and we will see later, we could update the state but still we want to recover or reset or be able to return to the first state of our store. So, we are going to create here another method, getInitialState. But now, we are not returning the state but initial state. This initial state, we are going to create it right here with the first state. And we are going to assign the state itself. So, we are creating for the first time the state, but as well, we are creating the variable initial state. This method is from the API as well. So, we use it. We get initial state. And now, we have one more test.

Okay. Don't worry. We are not going to be one by one because there are plenty of them. The test that is passing right now is the next one that we are returning the initial state using the getInitialState. Fine. So, now, the tricky part. We have to update the state. So, for that, we are creating a new one, setState. And the method setState is going to get a partial. A partial would be like the part of the state that we want to update. At the beginning, we could think that when we want to update a state, we just pass the new value. So, we are going to think, for example, that the new state is going to be the partial. That's all. Directly. Let's call this nextState. We assign directly the partial. And that will be a way to just update the state. State with the nextState. This state is a new method that we have to use it here for the API.

6. Handling Partial State Updates and Using Functions

Short description:

Introducing createState, updating store efficiently, handling partial state updates, and utilizing functions for state updates.

And as well, the createState. Now, we have the possibility to pass as an argument as well. Perfect. Now, we have 10 tests. That's something. So, we now are able to update our store, as we can see here, as a test. We are able to update the state. But the problem is that we are updating the state when we have to replace the state. So, this kind of example is working as expected. Because we are replacing the whole object.

But what happens when I just want to update a part of it, like this one? The problem with this kind of state is that I only want to update the count. But this is not passing. Because it's getting replaced. So, I have to make sure that I'm checking the type of the partial. So, we have to check if we have to replace. See if type of nextState is different than an object or nextState is null or is an array. That's the funny thing with JavaScript, that type of array is an object. So, we could break things.

Now, we know that if we have to replace the state or we have to extend the state that we had before with the next one. With this, hasToReplace, we are going to be able to come here, hasToReplace, and check. If we have to replace, we just assign the new state. And if not, we are going to use the previous state and the next state in order to be able to update. And now, we have three more tests. Another cool feature about global state managers or setState as well is the possibility of passing, like, a function to update the state. And right now, I'm going to check if I have an example of this. Trigger listening. Let's function. I think it's here. Yeah. Should update the state using setState with function.

7. Implementing Functions and Managing Listeners

Short description:

Implementing functions for updating state, managing listeners for state changes, ensuring components update with state changes.

Right now, this is not working because if you check this line, I'm using the partial as it is and I'm not checking if this is a method in order to update the state. I'm just assigning it. So, I make to, I have to make sure that I'm able to use functions as well. So, let's say this is a function, then I'm going to execute it and I'm going to assign what is returning this method, this function, to the next state. Okay. So, now we have two more. Perfect. We have partials.

Now, we have to work with listeners because we want to subscribe to every change that the store is going to get or is doing. So, any component, any store that is using it, is going to be able to re-render only when it changes. For that, I'm going to create here a const with a bunch of listeners, listeners with a set. And now, I'm going to create a new API called subscribe where you could pass a listener. And then here, we add the listener to the set of listeners and will return a way to unsubscribe and delete that listener from the listeners.

This subscribe method, it's a new API so we have to put it here. Okay. And now, it seems to be working two more tests. But the problem is that we still are not updating the components when the state changes. Why? Because every time that we change the state, we are not telling the listeners that everything is happening. So, every time that we change here, we have to call every listener. Okay. And tell him that a new state is there. Now, with the listeners, we only, we don't want only to send a new state but we want as well to have the previous state in case that you want to compare something. So, I'm going to, before updating the state, I'm going to have here a previous state.

8. Setting Up Custom Hooks and Selectors

Short description:

Assigning state, creating custom hooks for reading and connecting to the store, defining selectors for subscribing to specific parts of the state.

I'm going to assign a state before updating it. And here, a listener, I'm going to the second one is going to be the previous state. Okay. We have 21, only 14 to go. This is all that we need for the vanilla store but we need as well like the custom hook for React.

So, let's go to the React part and create a way to create a custom hook that it's able to read this store that we are creating vanilla. The good thing is that we could create like a React connector, a Vue connector, Svel connector, and so on. The first thing would be use the create store. So, we create a store using the create store that is the function that we created before and we pass the create state, the state that we are receiving from the parameter.

We have to import the create store. We have to define a selector. The default selector is going to be just select the same store. But this is interesting because we are going to be able to say the part of the state that we want to subscribe to. So, instead of reading or subscribing to the whole store, we are going to be able to just subscribe to a part of it. And that's the tricky one. That's the most important thing. We're not going to use no context providers or a state.

9. Subscribing to External Stores and Error Handling

Short description:

Creating custom hook 'use store' for subscribing to external stores without traditional React hooks like useState or useEffect, managing state updates efficiently.

So, we need a way to subscribe to this store and inform to the component. For that, we are going to use a custom hook that is called use sync external store. Okay? So, we are going to create a custom hook called use store. We pass the selector. For now, we have the default selector, the one that we created before. And we use sync external store. This is a hook from React that is going to let you subscribe to something that is external from React. It's not something only for global state managers.

I have here also an example. The first parameter is for subscribing. The second one to get the value every time that the value is changing. And the third one is optional. It's for server-side rendering, for example, for grabbing the first value. And this is an example for the text, if the user is online or offline using a window event. And it could be very interesting because, as you could see, there is no use state, use effect. You don't need anything. Only the subscription to the event when everything, every time that the value is changing, grabbing the value and for the first initial load as well.

So, we now have that. We only need to attach all the API that we have created to the store. Okay. And return the user store hook that we have created. Oh, one fail. Okay. No problem. And that's funny. So, we have one fail test. This is easy to fix because we have to make sure that if we are using the same state as before, we don't update the state. This is something that React do as well in the internals.

10. Optimizing State Management and Gratitude

Short description:

Fixing state updates in the global manager with React internals. Demonstrating unnecessary re-renders on buttons and the solution using selective subscription to store parts.

This is easy to fix because we have to make sure that if we are using the same state as before, we don't update the state. This is something that React does as well in the internals. So, we have to make sure that if it's the same state, the object of the next state and the current state is the same. We just return; we don't do anything. And we have now our global state manager working in 50 lines of code.

To check that this is working as expected, I have this demo that has been broken the whole talk. In different places, we are reading this state and could reset the button. We could see right now that this part is being re-rendered, and the buttons are re-rendered unnecessarily. To fix this, we could use the selector mentioned before, subscribing to each part of the store individually instead of grabbing the whole store at once.

It's not fancy, but it's 50 lines of code. Right now, we should not get a re-render on the buttons because we are subscribing only to the part of the store that we care about, which is the way to update the state and not the counter. I want to thank a lot of people for this, including Julian Vernot, who wrote an article called 'Creating a Global Estate Manager in 50 Lines of JavaScript' using proxy objects, which is super interesting and recommended.

11. Efficient Button Re-render Prevention

Short description:

Explaining selective subscription to store parts for efficient button re-render prevention.

We have in different places we are reading this state. We could reset in different places the button. And if we check when it's happening, the re-renders, we could see right now that this part is being re-rendered. And I want to explain this because it's important. As you can see, the buttons are being re-rendered when you don't need it because we are not showing the counter.

To fix this, we could use the selector that I mentioned before. So, we could go here to the code and the place where we have, we are using this, the buttons, we could be able here instead of grabbing the whole store and then extracting the properties of the methods, we could be able to just one by one subscribe to each part of the store.

So, now, with that, it's true. It's not fancy, but it's 50 lines of code. So, it's what it is. And the thing is that right now, it should be that we don't get the re-render on the buttons because we are subscribing only to the part of the store that we care, that is the way to update the state and not the counter. So, if the counter is updated, the controls are not being re-rendered.

QnA

Gratitude, Redux, Signals, Debugging

Short description:

Expressing gratitude, discussing Redux, Signals, debugging, and state inspection without dev tools.

So, I want to thank, obviously, a lot of people for this. Julian Vernot wrote an article called Creating a Global Estate Manager in 50 Lines of JavaScript. But it's not the same way. It's using proxy objects. It's super interesting. I recommend it. I want to thank Sustan because the source code is super, super easy to understand and the whole example is based on their code base. Redux for being such an amazing library, BAN, React Team, and the funny cat give thanks to a cat. The code and the presentation, you have available in GitHub with all the code that you have seen today. And I hope you learned something today and enjoyed the talk as much as I did. So, thank you so much. Thank you.

Questions are coming in. So, the first question is, are you building a mix of Redux and Signals? No. I mean, I hope that Signals are going to be available native to JavaScript someday so we don't need to do some of the fancy stuff. But to be honest, what we did, it's only event pops up. I mean, publish events and subscribe to events. The most magic thing is use external sync store that is a hook from React that it lets you to subscribe to events and then it gives you the magic that you need in order to do this.

How do you handle debugging and state inspection without the built-in dev tools? Well, I don't expect my library of 50 lines of code to be like production-ready state management library. But anyway, in some places that we have updated this state, we could use the hook from React, use the back value in order to be able to put some values to the React developer tools. That would be one idea. But you only have to put some lines in the source code and that's all. I mean, the only thing that is because we don't have time here to show it, but it's kind of adding stuff. Nice.

Global State Management Choices and Implementation

Short description:

Discussing Zestand, Redux toolkit, deep object checking, and event emitter for global state management.

But you only have to put some lines in the source code and that's all. I mean, the only thing that is because we don't have time here to show it, but it's kind of adding stuff. Nice. So, at the end, for production, Zestand is the one to go? So the creator of Zestand is here? So, I mean, I love Zestand, but I think that we have plenty of options for a reason. We don't have a silver bullet for global state management. For example, sometimes you could use time stack query and that's all you need. I would say just use the one that makes you happy. Right now, Redux toolkit is a great tool. It's nothing compared to the Redux that we had to suffer like 10 years ago. So, I don't know. Zestand is great, but be free. I love just use what makes you happy. That's the way to go in all accounts. Yeah, absolutely.

How does the store deal with a deep checking of object differences? Yeah. So, this store is not doing this kind of deep checking, obviously. It's not that hard. We could do it. But we could even use a structure clone in order to be able to copy the state and just what we need to update it. But you need a bunch of lines, like, I don't know, six lines of code in order to do this. So, right now, it's not dealing with it, of course. Yeah.

Why not just use event emitter? Well, that's a good thought, but we don't need it. I mean, it's similar. What we need is something similar in three lines of code without dependencies. It's like a set that you only have to send the value every time that it gets updated. I don't think it's needed. And if you are talking about more just using an event emitter for a global state manager, the problem with it is that you still need everything else. Creating the custom hook, how to update the store, that's the problem, and that's the thing that we try to solve today. Awesome. Well, thank you so much. Thank you so much. Really informative. Thank you.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

A Guide to React Rendering Behavior
React Advanced 2022React Advanced 2022
25 min
A Guide to React Rendering Behavior
Top Content
This transcription provides a brief guide to React rendering behavior. It explains the process of rendering, comparing new and old elements, and the importance of pure rendering without side effects. It also covers topics such as batching and double rendering, optimizing rendering and using context and Redux in React. Overall, it offers valuable insights for developers looking to understand and optimize React rendering.
Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a web framework built on React Router that focuses on web fundamentals, accessibility, performance, and flexibility. It delivers real HTML and SEO benefits, and allows for automatic updating of meta tags and styles. It provides features like login functionality, session management, and error handling. Remix is a server-rendered framework that can enhance sites with JavaScript but doesn't require it for basic functionality. It aims to create quality HTML-driven documents and is flexible for use with different web technologies and stacks.
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced 2023React Advanced 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
Watch video: React Compiler - Understanding Idiomatic React (React Forget)
Joe Savona
Mofei Zhang
2 authors
The Talk discusses React Forget, a compiler built at Meta that aims to optimize client-side React development. It explores the use of memoization to improve performance and the vision of Forget to automatically determine dependencies at build time. Forget is named with an F-word pun and has the potential to optimize server builds and enable dead code elimination. The team plans to make Forget open-source and is focused on ensuring its quality before release.
Using useEffect Effectively
React Advanced 2022React Advanced 2022
30 min
Using useEffect Effectively
Top Content
Today's Talk explores the use of the useEffect hook in React development, covering topics such as fetching data, handling race conditions and cleanup, and optimizing performance. It also discusses the correct use of useEffect in React 18, the distinction between Activity Effects and Action Effects, and the potential misuse of useEffect. The Talk highlights the benefits of using useQuery or SWR for data fetching, the problems with using useEffect for initializing global singletons, and the use of state machines for handling effects. The speaker also recommends exploring the beta React docs and using tools like the stately.ai editor for visualizing state machines.
Routing in React 18 and Beyond
React Summit 2022React Summit 2022
20 min
Routing in React 18 and Beyond
Top Content
Routing in React 18 brings a native app-like user experience and allows applications to transition between different environments. React Router and Next.js have different approaches to routing, with React Router using component-based routing and Next.js using file system-based routing. React server components provide the primitives to address the disadvantages of multipage applications while maintaining the same user experience. Improving navigation and routing in React involves including loading UI, pre-rendering parts of the screen, and using server components for more performant experiences. Next.js and Remix are moving towards a converging solution by combining component-based routing with file system routing.
React Concurrency, Explained
React Summit 2023React Summit 2023
23 min
React Concurrency, Explained
Top Content
Watch video: React Concurrency, Explained
React 18's concurrent rendering, specifically the useTransition hook, optimizes app performance by allowing non-urgent updates to be processed without freezing the UI. However, there are drawbacks such as longer processing time for non-urgent updates and increased CPU usage. The useTransition hook works similarly to throttling or bouncing, making it useful for addressing performance issues caused by multiple small components. Libraries like React Query may require the use of alternative APIs to handle urgent and non-urgent updates effectively.

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured Workshop
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
Next.js for React.js Developers
React Day Berlin 2023React Day Berlin 2023
157 min
Next.js for React.js Developers
Top Content
Featured WorkshopFree
Adrian Hajdin
Adrian Hajdin
In this advanced Next.js workshop, we will delve into key concepts and techniques that empower React.js developers to harness the full potential of Next.js. We will explore advanced topics and hands-on practices, equipping you with the skills needed to build high-performance web applications and make informed architectural decisions.
By the end of this workshop, you will be able to:1. Understand the benefits of React Server Components and their role in building interactive, server-rendered React applications.2. Differentiate between Edge and Node.js runtime in Next.js and know when to use each based on your project's requirements.3. Explore advanced Server-Side Rendering (SSR) techniques, including streaming, parallel vs. sequential fetching, and data synchronization.4. Implement caching strategies for enhanced performance and reduced server load in Next.js applications.5. Utilize React Actions to handle complex server mutation.6. Optimize your Next.js applications for SEO, social sharing, and overall performance to improve discoverability and user engagement.
Concurrent Rendering Adventures in React 18
React Advanced 2021React Advanced 2021
132 min
Concurrent Rendering Adventures in React 18
Top Content
Featured Workshop
Maurice de Beijer
Maurice de Beijer
With the release of React 18 we finally get the long awaited concurrent rendering. But how is that going to affect your application? What are the benefits of concurrent rendering in React? What do you need to do to switch to concurrent rendering when you upgrade to React 18? And what if you don’t want or can’t use concurrent rendering yet?

There are some behavior changes you need to be aware of! In this workshop we will cover all of those subjects and more.

Join me with your laptop in this interactive workshop. You will see how easy it is to switch to concurrent rendering in your React application. You will learn all about concurrent rendering, SuspenseList, the startTransition API and more.
React Hooks Tips Only the Pros Know
React Summit Remote Edition 2021React Summit Remote Edition 2021
177 min
React Hooks Tips Only the Pros Know
Top Content
Featured Workshop
Maurice de Beijer
Maurice de Beijer
The addition of the hooks API to React was quite a major change. Before hooks most components had to be class based. Now, with hooks, these are often much simpler functional components. Hooks can be really simple to use. Almost deceptively simple. Because there are still plenty of ways you can mess up with hooks. And it often turns out there are many ways where you can improve your components a better understanding of how each React hook can be used.You will learn all about the pros and cons of the various hooks. You will learn when to use useState() versus useReducer(). We will look at using useContext() efficiently. You will see when to use useLayoutEffect() and when useEffect() is better.
Introducing FlashList: Let's build a performant React Native list all together
React Advanced 2022React Advanced 2022
81 min
Introducing FlashList: Let's build a performant React Native list all together
Top Content
Featured Workshop
David Cortés Fulla
Marek Fořt
Talha Naqvi
3 authors
In this workshop you’ll learn why we created FlashList at Shopify and how you can use it in your code today. We will show you how to take a list that is not performant in FlatList and make it performant using FlashList with minimum effort. We will use tools like Flipper, our own benchmarking code, and teach you how the FlashList API can cover more complex use cases and still keep a top-notch performance.You will know:- Quick presentation about what FlashList, why we built, etc.- Migrating from FlatList to FlashList- Teaching how to write a performant list- Utilizing the tools provided by FlashList library (mainly the useBenchmark hook)- Using the Flipper plugins (flame graph, our lists profiler, UI & JS FPS profiler, etc.)- Optimizing performance of FlashList by using more advanced props like `getType`- 5-6 sample tasks where we’ll uncover and fix issues together- Q&A with Shopify team
React, TypeScript, and TDD
React Advanced 2021React Advanced 2021
174 min
React, TypeScript, and TDD
Top Content
Featured Workshop
Paul Everitt
Paul Everitt
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.

The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.

React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way we'll show test-driven development and emphasize tips-and-tricks in the IDE.