On each re-render it generates a new color. How do I cache the first color it gets initialized and re-use it each now?
const backgroundColor = newBackgroundColor(); // some random color const background = React.useMemo(() => { return backgroundColor; }, []); const buttonStyle: React.CSSProperties = { background: background, }; return (<button style={buttonStyle}> )