Export more utility hooks, component hooks, contexts, types, etc.. where possible #5376
akinzalowevidation
started this conversation in
Feature request
Replies: 1 comment
-
Hey @akinzalowevidation, Thanks for your suggestions. We'll need some discussion on this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
We wrap most of the NativeBase components to add our own functionality and in some cases create our own NativeBase components from scratch. We've had success with this so far, despite some having to have some ugly imports such as:
This works fine for types, but not anything else.
Today we began making our first component from scratch that relied on interaction states. Upon further investigate we discovered that other NB components rely on hooks defined in
Pressable
(useHover
,usePressed
, etc..). These hooks do not appear to be exported, making it difficult to build our own components and attempt to follow NB component structure - most notably usingusePropsResolution
.Problem Statement
Currently it is not fully possible to create some custom NativeBase-like components by exporting types, hooks, or other components from
native-base
. For users that create an internal component library that wrapsnative-base
, this is an important requirement to have.Proposed Solution or API
Export more (or all) types, utility functions (such as
mergeRefs
), utility hooks, component hooks, component contexts, etc.. out ofnative-base
.Alternatives
We could fork NativeBase, but our goal is not to add additional features or changes to NativeBase itself, but rather just utilize all existing features NativeBase has to build our own components in the same manner that NativeBase components are built.
It is also much easier in these cases where we are wrapping NativeBase to simply upgrade a NativeBase version over maintaining forked code.
Additional Information
If needed, I can offer some more use case examples.
Beta Was this translation helpful? Give feedback.
All reactions