Closed leezumstein closed 2 years ago
Sorry for the delay.
Merged and released v4.4.3
Sorry for the delay. Merged and released
v4.4.3
No worries, thanks for taking a look + releasing!
@saleel I just checked and it looks like v4.4.3
hasn't landed on npm just yet. Wasn't sure if an action wasn't kicked off for the new version to publish it?
@leezumstein It was my mistake. I forgot to publish and only pushed to master instead. Published now - 4.4.3
@leezumstein It was my mistake. I forgot to publish and only pushed to master instead. Published now - 4.4.3
Yup I see it now, thanks again!
Context
Updating the types for
FlatGrid
andSectionGrid
so we can leverage theref
attribute for the underlyingSectionList
andFlatList
. This allows the consumer to do something like the following:Without these changes, the components are typed with the
ref
attribute asFlatGrid<number>
, which doesn't expose any of the methods defined byFlatList
.Image of the typing errors we were running into our project with the current implementation:
Image of the updated types being inferred after these changes are made:
Changes
FlatGrid
andSectionGrid
types to be Functional Components with ref attributes inherited fromFlatList
andSectionList
React.forwardRef
essentially, which is what is used by the code implementation, anyways