Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: prefetch capacity in react-native #119

Open
Elindorath opened this issue Feb 11, 2025 · 0 comments
Open

Feature request: prefetch capacity in react-native #119

Elindorath opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Elindorath
Copy link

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 prefetch function 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.ts and the src/react-native/compute.ts files).

What do you think?

@mbgspcii mbgspcii self-assigned this Feb 11, 2025
@mbgspcii mbgspcii added the enhancement New feature or request label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants