Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
import { useRef, useEffect } from 'react'; | |
/** | |
* a type-safe version of the `usePrevious` hook described here: | |
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state} | |
*/ | |
export function usePrevious<T>( | |
value: T, | |
): ReturnType<typeof useRef<T>>['current'] { | |
const ref = useRef<T>(); |