Post

JavaScript Exchange
JavaScript Exchange@JavaScript_Ex·
Based on his Career-o-meter, @williamheslam explains: PT1. "Each of the four child components has internal state, which makes them hard to test." Can we avoid this? "We could consolidate all the state into a 'smart' parent component, making the children all pure components"...
JavaScript Exchange tweet mediaJavaScript Exchange tweet media
English
1
0
0
0
JavaScript Exchange
JavaScript Exchange@JavaScript_Ex·
PT 2. OR... Dependency injection! Pros: -Pure, avoids mutating global dependencies -Explicit, makes it clear what a component does or does not use Cons: - Unwieldy when composing components... #React #JavaScript #testing
JavaScript Exchange tweet media
English
0
0
0
0
مشاركة