Create Collaborative VR Environment in the Browser with React and GraphQL

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2025
November 17 - 20, 2025
New York, US & Online
See JS stars in the US biggest planetarium
Learn More
In partnership with Focus Reactive
Upcoming event
JSNation US 2025
JSNation US 2025
November 17 - 20, 2025. New York, US & Online
Learn more
Bookmark
Rate this content

Virtual Reality gives us an ability to experience virtual worlds from the comfort of our homes. But it doesn't have to be experienced alone. In this talk we will see how we can use React, WebVR and GraphQL to create social VR experience in the browser.

This talk has been presented at React Summit 2020, check out the latest edition of this React Conference.

FAQ

A-Frame is a web framework for building virtual reality (VR) experiences. It is built on top of HTML and incorporates 3JS, allowing developers to create complex VR experiences using an entity-component system. A-Frame supports features like physics, particle effects, movement, and controllers, making it suitable for developing interactive VR environments using JavaScript.

React 360 is specifically designed for creating 360-degree user interfaces and is not intended for full VR experiences that include walking around. It utilizes a React Native-like architecture, running in a web worker with a bridge to manage communication between the browser and the VR environment. React 360 focuses on rendering UIs on curved surfaces, enhancing the user's visual experience.

The entity-component system in A-Frame involves entities that act as containers to which components are attached. Components define the appearance and behavior, while systems manage groups of entities and components. This system allows for modular and reusable code in VR development, similar to how components work in React.

Yes, A-Frame can be integrated with React using custom wrappers or libraries like React A-Frame, although some may not be actively maintained. Developers can wrap A-Frame elements within React components, allowing them to manage the VR scene using React's state and props system.

React 360's architecture is based on React Native, intended to optimize 360-degree UI creation. It functions by running React in a web worker to manage the UI logic separately from the rendering process, which occurs in the browser context. This separation helps in managing performance and interaction in complex VR environments.

GraphQL allows developers to efficiently fetch data in the shape they need, which is crucial for real-time VR applications. Hasura provides an auto-generated real-time GraphQL API, making it easier to build interactive and collaborative VR applications. This combination simplifies data management and updates in VR environments, enhancing user experience.

Vladimir Novick
Vladimir Novick
26 min
17 Jun, 2021

Comments

Sign in or register to post your comment.
Video Summary and Transcription
This video talk explores how to create collaborative VR environments in the browser using React and GraphQL. It discusses key tools for VR development, such as A-Frame and React 360. A-Frame is a web framework built on HTML and 3JS, enabling complex VR experiences with features like physics and particle effects. React 360 focuses on 360-degree user interfaces and uses a React Native-like architecture. The talk emphasizes using GraphQL for real-time data handling in VR, highlighting the capabilities of Hasura for auto-generated real-time GraphQL APIs. The video also covers the integration of VR controllers and headsets, the use of raycasting for interactions, and the entity-component system in A-Frame. Finally, it mentions the importance of combining microservices and third-party APIs into a single GraphQL facade for collaborative environments.

1. Conclusion

Short description:

This is the end of the video. We'll see you in the next video. Have a great day. Thanks for watching.

This is the end of the video. Thanks for watching. We'll see you in the next video.

Until then, have a great day. And as always, thanks for watching.

Here's my Twitter. Thanks for watching. Have a great day. Bye-bye. Thank you. Have a great day. Bye-bye. Bye-bye. Thank you. Have a great day. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

2. Conclusion

Short description:

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

3. Farewell

Short description:

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

4. Farewell

Short description:

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

5. Farewell

Short description:

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

6. Farewell

Short description:

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye. Bye-bye.

7. Creating VR Experiences with A-Frame and React 360

Short description:

What are our solutions today if we want to still create some kind of VR experience? With webVR and webXR, you can get sensor and headset positioning for UI interactions. Aframe is an amazing library that wraps around 3GS and offers a wide range of capabilities. Another option is to use Unity or Unreal Engine. Let's focus on A-Frame and React 360. A-Frame provides examples of experiences, from simple to complex, like a Minecraft-like world or a Beat Saber type of game. A-Frame uses coordinate systems.

Bye-bye. Bye-bye. Bye-bye. So, what are our solutions today if we want to still create some kind of VR experience? And I'm using Chrome here, and we'll still be using VR. So, with webVR and webXR, if you don't have webXR enabled in the browser, it defaults to, like, 3D environment, and, like, game-like experiences, and so on. Which is also good, and it's nice. We'll see today.

So, with webVR and webXR, you can actually get your sensor positioning, you can get your headset positioning, and based on that, you can do interactions with the UI. For that, you can use different tools. One is for developing that. One is Aframe, which is an amazing library and huge community that basically wraps around, like, 3GS and gives you lots of capabilities, like physics, particle effects, movement, controllers, breakcasting, you name it. Lots of things. And you can actually create really complicated experiences with that, just by using its so-called NT component system and using JavaScript. Now, if it uses JavaScript, obviously, we can embed this in React, as well, and we'll see today how it's done. Another option is just to fall back to best practices in terms of game engines. So we can use Unity game engine and develop something in C-Sharp, or we can use Unreal Engine and develop in C++, or their so-called feature, feature so-called Blueprints. But we are not here to talk about Unreal Unity, so we are here to talk about both A-Frame and React 360. Mostly about React 360. So, let's continue.

Let's take a look at the A-Frame and let's look at the examples of experience that you can get. I don't have VR enabled here because I'm on Chrome, but I still can navigate the environment by pressing arrow keys and by just looking around this wall of basic shapes, right? So this is a nice experience, but it's just like a really simple one, right? I want to see something more complex. So for more complex, let's get into a directory of different examples. One of such examples is Minecraft-like world, VR blocks, you can go around it, navigate And it's pretty awesome what you can do just with the power of A-Frame and JavaScript, right? You can get all this cool stuff here. So apart from that, let's take a look at something more complex, something more like Beat Saber type of thing, if you played on the Quest or other devices, so we can get something like this also developed in A-Frame. I think it's pretty nice, also music is kind of nice here. You absolutely cannot create something like that in React 360. So with A-Frame you can do really amazing hypnotizing experiences, right? So pretty cool what you can do with that. Now, what A-Frame uses. A-Frame uses coordinate systems. Not just A-Frame.

8. Coordinate Systems and A-Frame

Short description:

3D environments use coordinate systems, either left-handed or right-handed. A-frame uses an entity-component system. A-frame code consists of entities and components. React 360 is built for 360 user interfaces based on React native architecture.

Basically every 3D environment uses coordinate systems and one of these... This system is basically either left-handed or right-handed. And the idea is if you take your hand and you point the middle finger at you, so the Z axis will be the point at you. So it means that positive X will be to the right side and the negative X to the left side. If you need to position something in front of the viewer, it will be minus Z and so on. So we use right-handed coordinate systems.

So when you see coordinates, keep in mind that we'll have these coordinate systems, both in A-frame, in React 360, and so on. So X direction also changes when applied rotation, so if we rotate something to the right, then all the Xs change, and we need to take this into account.

A-frame uses entity-component system, which means it consists of entities, components, and systems. Entities are containers into which components can be attached. So when you'll see in the code, it looks more like entities are like React components, components are like props, and systems are the global systems like services and stuff. The reason why it's so is because in game engines, entity-component system is a pretty common pattern, and A-frame mimics that system. Unity also uses entity-component system, so it's pretty close.

If we look at the A-frame code, we'll see something like that. Let's take it. This just loaded, so I can navigate around and have these basic shapes. As you can see, I need to just import A-frame, bring a bunch of styles, and then this is the scene component, these are assets component, entity. I call it component but in A-frame, this is called entities, and like, background, fog, and scale, roughness, width segments, all of that are components. It's kind of misleading because in React we're used to that the whole thing is component, right? And these are props, but in A-frame, in documentation, you will see these are entities and these are components. The main point of showing that is that you can easily see that you can just take this and abstract that into React component and start using it. Right? So there is React A-frame library but I'm not sure it's maintained, I think it's not maintained for a while now. So you can just create wrappers yourself and as you can see it's just fairly straightforward here to pass different data to them and so on.

So what about React 360? So React 360 is built for 360 user interfaces, hence the name. The main idea is that you don't create these like fancy experience. You don't walk around. You just look at the curved screens and interact with curved screens in VR or in general in a 3D environment on the web. So the architecture of React 360 is actually based on React native architecture. We have React running in a web worker. When you bootstrap a new project, you will see an index.js. This code doesn't have any access to browser APIs.

9. Creating VR Experiences with A-Frame and React 360

Short description:

To create VR experiences with A-Frame and React 360, you need to define native modules in client.js that have access to browser APIs. Different surfaces, such as cylinder and flat, can be rendered, with the best practice being to put flat UIs on curved surfaces. To interact with the browser, you define native modules and register them using the Reactor 16 module. These modules can be used to share logic between different surfaces. On the React side, you use regular React components and React 360 components, such as VR button, which has different callbacks. In VR, raycasting is used to detect targets when projecting an invisible ray in a specific direction.

It's just running in a web worker. We have a React native bridge that uses MessageQueue to pass all the asynchronous messaging to the browser, to the client.js. Now, in client.js, you need to define native modules, which basically have access to browser APIs. To get started, you run npx React 360 CLI init. You get your demo app and then you get these kind of components. This is client.js, the one that has access to browser APIs. You have the init function, you have a bunch of React instance creation and you pass a bunch of stuff, such as getting default surfaces, setting background to the whole environment, and so on. We'll see more complicated examples here, but this is the thing that you will get once you create a new project.

What you can do now, you can render something on different surfaces. And there are several types of surfaces. The most important ones are the cylinder one and the flat one. Actually, it's supposed to be... This one's supposed to be cylinder, but anyways. Cylinder is a cylinder that surrounds you and rendering something on top of this cylinder will have something curved in front of you, so it will look better in UI. It's the best practice in VR user experience, in VR design, to put flat UIs on curved surfaces so it will look more natural, so to speak. And if you put a flat surface, then it's just a flat surface that you can position however you want, like set an angle, and that's it.

So to interact with the browser, you need to define different native modules. This is how we can define them. We import module from Reactor 16. We just define a class here, and we have the game state and game ID and user ID. And you understand in a bit what is this game state because it relates to the demo I will show in the end of the talk. Then you register these modules and you register them by adding native modules array here and adding a function that will get the context. And you can return a new game module, passing the context back. So you can use the context to pass callbacks around and so on. So this is pretty cool thing that you can create different surfaces, can create the game module to basically share your logic between different surfaces, because they are rendered in different places, basically. So on the React side, you use regular React components and you use different components provided by React 360. For example, you have VR button, and you have different callbacks for that, like on enter, on exit, on click. Now in VR, you have a concept of in general, in 3D environments. You have a concept of raycasting. When you project an invisible ray going into a specific direction, when it hits the target, it will return back the target that it hit.

10. VR Controllers and React 360

Short description:

When dealing with VR controllers or VR headsets, a raycast is projected from the camera or controller to hit buttons or targets in React 360. The VR button handles this functionality under the hood, triggering actions on enter or exit. The GameTile component in React 360 is similar to React Native, allowing for different styles, animations, and familiar development practices.

When dealing with VR controllers or VR headsets in general, there is a raycast projected from the camera or projected from the controller, and it hits the button or hits the target or hits something like that. So in React 360, VR button does that under the hood. If you just look at the button in VR, it depends on the headset or you point with a controller and enter the button space with the reticle of the controller, then it will trigger on enter or trigger on exit if you leave that. It's like on mouse enter or mouse leave, but in VR.

We have our component here, GameTile, and that's about it. It's pretty similar to React Native. I have views. We have different styles we can provide like so for the buttons. There are specific styles for positioning and so on. We can animate using Animated, similar to React Native, and basically use practices we're aware of and using for several years.

11. Bringing Data into VR with GraphQL

Short description:

We'll use GraphQL to bring data into our VR environment in real-time. GraphQL allows us to send one request to the server and get the data we need in the desired shape. It provides introspection of server activities and supports different types. GraphQL is amazing!

So what about the data? How we can bring in the data into our VR environment? And in addition to that, how we can bring it in real-time? We're talking about collaborative VR environments. We need to bring some data. We need to have data updated constantly, and so on.

So for that we'll use GraphQL. GraphQL, as you all probably know, is a query language for the API, and it's like magic that just works. I'm really passionate about GraphQL. I talk a lot about GraphQL, so this talk is no different. We'll talk about that as well.

So the idea with GraphQL is that we can send one request to the server and get all the data that we need, and the shape of the data will be the same as we requested. So it gives us a lot of benefits of having the data when we need and in the shape that we need, and having all the introspection of what is happening on the server.

So this is how GraphQL looks like in sandbox environment, pretty simple one. And under the hood, we're sending the query and getting the data back. The query is sent in stringified format with variables, and we're getting back the data in JSON. Now this is more like a realistic format, how it will look like in production. This is like a Star Wars API. We have different directives, we have variables, we have different types, so GraphQL is all about types. So yeah, GraphQL is amazing, and we will use it for our talk as well.

12. Architecting Collaborative Systems with Hasura

Short description:

So what about architecture and especially how about architecting something collaborative? We have different microservices and third party APIs combined into one GraphQL facade. The best practice is to use three-factor-up architecture. Hasura is an open-source engine that provides auto-generated real-time API and many features. It serves as the backend for a tic-tac-toe game with subscriptions for real-time updates.

So what about architecture and especially how about architecting something collaborative, right? So lots of things happening asynchronously. We have different third parties APIs, we have lots of moving parts and obviously, architecture wise, we need to think about more like microservices or architecture.

So having different microservices here and third party APIs and everything combined into one GraphQL facade that will return everything back. And the best practice to my experience is to use something called three-factor-up architecture. And architecture is something similar to that.

You have an app which talks with the real-time GraphQL API. It updates some kind of state in the database or wherever you like and will trigger events. Now, events will trigger a serverless function that will update the state and basically do the processing that it needs. And when state is updated, everything is propagated back to the client using subscriptions.

So, for our example, we will use Hasura, which is an open-source and free engine, gives you auto-generated real-time API, and on top of new and existing PostgreSQL. And it has a bunch of features that I won't go through right now but you can read that after the talk in the slides. There are lots and lots of features. This is just the tip of the iceberg.

To see in action our environment we can go to Hasura console and see something like this. We can have, we have a game with a bunch of moves happening. We can see these moves, like a subscription is running, and we get a bunch of data back. This is a subscription that I am calling. And I always can insert a new move and this will be updated. Now, of what this serves, this backend serves this demo.

So basically, I have a tic-tac-toe game and I have here a bunch of... I can change my background, I can change it from being a grid to being like a Skyrim background. I can have a chat, I can scroll on this chat. The coolest thing here is that we have subscriptions in place, and it's all real-time. For example, if I will click on something here, you see this one was updated. And let me click here again, I got another move updated here. Now in turn, if I will go and I'll stop that, it will execute a move. Let's say we have a row number 0 and column 2. Let's write move here, 0, 2. We insert a move. What will happen? Oh, yeah, it's like a race.

13. Adding VR and A-Frame to React 360

Short description:

This is pretty cool, how we can do this with React 360 and Hasura together and create this kind of environment. And also, we can chat here. The code is in GitHub. So you're welcome to look through the code. How we add things to VR, how we add things, for example, here in A-Frame, we basically add Apollo, Apollo Provider. We have our HTTP link. We have a WebSocket link. And we wrap everything with Apollo Provider. In A-Frame, it's like a blog post list in A-Frame. So maybe it's a bad example. But anyway, you can go into posts here, and it will get the subscription, getting all the data back. And you can see that you can update lots of stuff. There's different endpoints, so you will see different things here. How to add stuff to React 360? You add a poll provider. You add our game board. And basically, you execute subscriptions. You execute queries. Now, before finalizing this talk, let's look briefly through the code here. And here we see our client.js. And client.js will have multiple things.

It starts from 0. So we have this one added, or let's add another one, insert move. And you see everything is updated in VR and in real-time. This is pretty cool, how we can do this with React 360 and Hasura together and create this kind of environment.

And also, we can chat here. The code is in GitHub. So you're welcome to look through the code. We will briefly look through that. But you're welcome to look more closely at the code and comment on that, and so on.

So how we add things to VR, how we add things, for example, here in A-Frame, we basically add Apollo, Apollo Provider. We have our HTTP link. We have a WebSocket link. And we wrap everything with Apollo Provider.

Now here, in A-Frame example, it looks pretty ugly, because A-Frame is not built for something like this. It's built more for games and interaction. So I did the other things around. The tic-tac-toe game was a game in React 360. In A-Frame, it's like a blog post list in A-Frame. So maybe it's a bad example. But anyway, you can go into posts here, and it will get the subscription, getting all the data back. And you can see that you can update lots of stuff. There's different endpoints, so you will see different things here. So you're welcome to play around with that after the talk.

How to add stuff to React 360? You add a poll provider. You add our game board. And basically, you execute subscriptions. You execute queries.

Now, before finalizing this talk, let's look briefly through the code here. And here we see our client.js. And client.js will have multiple things.

14. Rendering and Wrapping Components

Short description:

We'll have cylinder surfaces rendering the whole game board. The VR chat panel and game gathering will be rendered on the sides. The logic is done through native modules. The Index.js file registers multiple components, such as VRChatPanelComponent and GameGallery. The bold rendering involves executing mutations on click. React 360 is not updated to the recent version of React, so hooks cannot be used. However, A-frame can be easily used with hooks and context in React. In conclusion, get into VR and AR, try creating demos, and explore new things. Enjoy the conference!

We'll have cylinder surfaces rendering the whole game board. And we have our VR chat panel rendering on the right side of things and game gathering rendering on the left side where you can change the background. And the whole logic is done through the native modules.

Here we have one native module called GameModule, and it will be shared later on. Not now, but it can be shared between these instance and other instances here. We have, yeah, it can be shared across the whole thing.

We can also look into Index.js. Index.js is registering multiple components. Now you have to register a component, VRChatPanelComponent, to use that or GameGallery. You have to register that, because these are different roots. And you basically, you basically wrap each one of them with a polar wrapper. And you can use subscriptions inside.

So here I can render the bold. And the whole idea with the bold rendering is that I have the matrix that I go through and I basically execute mutations whenever I click. One caveat, the React 360, unfortunately, is not updated to the recent version of React. So unfortunately we cannot use hooks. So we still use like the old method of render props with mutation and you have a componented mount and all of this stuff. I wish the hooks will be there soon, but it doesn't depend on me. So whenever it will be ready, it will be ready. Meanwhile, you can use A-frame easily with hooks and context and all the new React by just dropping A-frame components and so on.

So let's get back here, and before wrapping up, I just want to, first of all, thank you, thanks for React Summit organizer for inviting me, and I want to basically encourage you to get into VR and AR try things, and try to create these amazing demos that were created for A-frame. Create amazing demos for React 360. Experiment. Play around with the code. VR is just starting, it's just getting into the browser. It's still not supported everywhere, but it will be. So get into this stuff, try to learn new things, thanks for having me, and enjoy the conference. Bye-bye. See ya.

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.