Feature request: prefetch capacity in react-native
Hi there,
Here at Staycation, we have recently made use of your react-native component, but we faced an issue that is not easily resolvable on our end: previously, when we only used the <Image> component from react-native, we were able to call its prefetch method before a navigation step. This ensured that the header image on the next page was already loaded, preventing a loading state from being presented to the user.
Transitioning to the <TwicImg>, re-implementing this feature is not easy: the url need to be exactly the same between the prefetch call and the one computed by your component, the parameters must be in the exact same order.
Would you consider to add this capacity to your component?
I see two solutions to this issue:
- Ideal solution: expose a
prefetchfunction taking an object with the same interface the component takes. It would require to add a size property to replaced the size detection. - Otherwise, at least expose the internal functions used to parse the parameters and compute the url (mainly what's inside the
src/react-native/parse.tsand thesrc/react-native/compute.tsfiles).
What do you think?