Skip to content

Instantly share code, notes, and snippets.

View z2lai's full-sized avatar

Zheng Lai z2lai

View GitHub Profile
@thebuilder
thebuilder / hookWithRef.js
Last active January 16, 2024 13:50
Hook with ref callback
import React, {useCallback, useRef} from 'react'
function useHookWithRefCallback() {
const ref = useRef(null)
const setRef = useCallback(node => {
if (ref.current) {
// Make sure to cleanup any events/references added to the last instance
}
if (node) {

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@AdamMarsden
AdamMarsden / sassas.md
Last active June 27, 2024 07:59
Sass Architecture Structure

Sass Architecture Structure

sass/
|
|– base/
|   |– _reset.scss       # Reset/normalize
|   |– _typography.scss  # Typography rules
|   ...                  # Etc…
|