ReactJs Components
- clearly depicts the issue with keys when they are not used correctly
- key issue with list
- key is essential for arrays when doing updates in the ui -> adding an item in the end of the list works well
- in the beginning of the list react works worse, for that we should use key attribute
- the most used keys comes from the data
- when there is no data, using a math.random can be an option but it has a drawback, index is also not recommended as it can impact negatively performance
- indexes have a problem when they are prone to change (such as a reverse function), using index won’t update the state accordingly
-
controlled vs uncontrolled components
- simple form (uncontrolled)
- controlled form
-
contexts
- solves the prop drilling problem