Hopp til hovedinnhold

Caroline Odden

12 innlegg

UseEffects only for side effects

React
Artikkel (3 min)
Fra Caroline Odden
24.12.2023

I have created numerous bugs by using useEffect wrong, and I have learned the hard way how to solve them. As a result of my errors I have acquired a set of best practices I like to follow, and I like to share them with you. Happy reading!

Immutable state

React
Artikkel (3 min)
Fra Caroline Odden
18.12.2023

During my time as a React developer, I have experienced that you never should mutate your state, as it leads to weird bugs when rendering your components. This article will show you some tricks on how to make your state immutable, achieving a more bug-free UI.

React fights you can have with your team

React
Artikkel (9 min)
Fra Caroline Odden
13.12.2023

There are many ways to solve problems in React, some will say too many. In a large code base it is helpful if the developers are united about the way to maintain the code base. Take a look at the topics I present to you in this article, which one do you use and are you and your team on the same page?

Bekk Christmas 7.0

Meta
Artikkel (2 min)
Fra Kristofer Giltvedt Selbekk, Caroline Odden, Maria Skaaden, Ina Høie, Anders Larsen, Tor Martin Frøberg Wang
01.12.2023

Welcome to the seventh installment of Bekk Christmas

Put event logic in event handlers in React

React
Artikkel (4 min)
Fra Caroline Odden
16.12.2022

Changing the state of your component based on the interaction of a user is a common scenario in a React application. Your first instinct may be to put the event logic in a useEffect that depends on some value to change so the effect can be triggered. But why put the event-specific logic some other place than event handlers? To avoid misbehavior in your application, put event logic in the event handlers and not in useEffects.

Compute view logic during render in React

React
Artikkel (4 min)
Fra Caroline Odden
15.12.2022

Updating view logic based on some state or props is a common thing to do in a React application, and the go-to method is typically by putting every state update in one or more useEffects. However, this will lead to unnecessary updates and unmaintainable code. Let's take a look at how updating view logic is better by doing it during render rather than useEffects.

Use key to reset state in React

React
Artikkel (4 min)
Fra Caroline Odden
14.12.2022

Resetting state in a React application is a common thing to do. You get some new data in your props, and you want to set your state back to the initial values, and often it is done with useEffect. However, useEffects can be messy and hard to understand, and it's because you (and I) are using them wrong (🔥). Let's take a look at how to solve this in a better way by using the key attribute.

The View of Vue

Vue
Artikkel (10 min)
Fra Caroline Odden
04.12.2021

An introduction to Vue 3 from a React developer.

Textless Presentations

Talks
Artikkel (6 min)
Fra Caroline Odden
06.12.2020

When creating a presentation it's good to have your own style, adding your own touch. Over the years creating different presentations for conferences or for a demo, I have developed my own approach when creating the slides. I want to present it for you, and I hope you like it!

Seven Interesting Things About React Native

React
Artikkel (10 min)
Fra Caroline Odden
01.12.2020

React Native is a React framework developed by Facebook to write code for mobile applications. In this article I will share some things I found interesting over the years working with this technology.

Two Applications, One Repository

React
Artikkel (9 min)
Fra Caroline Odden, Kent Andersen
23.12.2019

When you’re developing similar apps for the web and native platforms, it's hard to find a project structure that works well. Let's take a look at how our team is approaching this challenge for maintaining different view layers, while sharing most of the business logic.

Stop... Render Time!

React
Artikkel (7 min)
Fra Caroline Odden
02.12.2019

The promise of Concurrent Mode was made at a conference in 2018. The React team claim that this famous new feature would help with the issues with rendering, allowing to pause the render when the need to do more important tasks should occur. Let's take a closer look!