Skip to content

Instantly share code, notes, and snippets.

View EverybodyKurts's full-sized avatar

Kurt Mueller EverybodyKurts

  • 03:22 (UTC -04:00)
View GitHub Profile

React.memo, React.useCallback, React.useMemo

Normally, function components are rerendered every time the application renders. If you have large/complex components, this can affect application performance.

You can use React.memo, React.useCallback, and React.useMemo to memoize parts of your application. This means that React will cache and reuse their previous results instead of rerendering them.

Example:

We start with a useReducer-based Counter application, with the following additions:

@EverybodyKurts
EverybodyKurts / DragDropPage.fs
Created February 7, 2022 03:19 — forked from JordanMarr/DragDropPage.fs
Fable bindings for "react-dnd" using HTML5 provider
module DragDropPage
open Feliz
open Fable.React
open Fable.React.Props
open ReactDND
type Language = {
Name: string
}
@EverybodyKurts
EverybodyKurts / PeopleList.swift
Created February 26, 2020 20:34
Creating custom bindings for an element inside a collection.
import SwiftUI
struct Person: Identifiable {
let id = UUID()
var firstName: String
var lastName: String
}
struct PersonField: View {

Keybase proof

I hereby claim:

  • I am kurtrmueller on github.
  • I am kurtrmueller (https://keybase.io/kurtrmueller) on keybase.
  • I have a public key whose fingerprint is 98A1 483A B0D5 AA92 ED3A 3715 463B 706C 1870 5112

To claim this, I am signing this object: