3 ms·
I've worked a little bit with libraries like this (react-mapbox-gl) and I think the point GP is making is more like this: <3P.Wrapper> <3P.Foo>
by mhink 9y ago
I've worked a little bit with libraries like this (react-mapbox-gl) and I think the point GP is making is more like this:
<3P.Wrapper>
<3P.Foo>
<3P.Bar
subcomponent={props}
/>
</3P.Foo>
{ someCondition ?
<3P.Quux
onCrunch={doQuack}{
/>
}
</3P.Wrapper>
where mounting and unmounting those child components interacts with the wrapped API. Contrast that with
<3P.BasicWrapper
useFoo
useBar
useQuux={someCondition}
onQuuxCrunch={doQuack}
/>
which is less suitable for generic use, but easy enough to write (and modify later) that you probably don't need a highly-generic wrapper.