LoginSignup
0
0

React Memo

Posted at

Attributes

In JavaScript, when the property name is the same as the value, we don’t have to write both the key and the value:
Instead of:
<div style={ { color : color} }>Clicks count: { count }</div>
you can do:
<div style={ { color } }>Clicks count: { count }</div>

Undefined Array

To create the certain length of undefined array in JavaScript.
const tempArray = [...Array(number)]

Put 'current' for UseRef

don't:
elementRef.style.color = 'salmon'
do:
elementRef.current.color = 'salmon'

Call useEffect Only the beggining

put empty array at the end
useEffect( () => { }, [])

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0