GithubHelp home page GithubHelp logo

Comments (3)

addyosmani avatar addyosmani commented on May 18, 2024 3

Thanks for creating https://www.npmjs.com/package/react-quicklink-component, @HOUCe. This is neat. Outside of leveraging React.children.map() for this I think your component might be the best option for React native users to take advantage of quicklink's concepts. We otherwise plan to focus on providing a lean core.

I'm going to close up this issue and suggest folks use the above component for RN 👍

from quicklink.

HOUCe avatar HOUCe commented on May 18, 2024 2

Hey @arximughal @addyosmani ,

I think quicklink can't work with React native/React projects by default. But we can use this anyway by creating a React native/React component which implements with quicklink.
I've made one, check react-quicklink-component. The <Quicklink> component was designed by render props pattern and connected with raw quicklink by ref.

So, we can use like so:

<Quicklink quicklink={options}>
  <Comp1 />
  ...
  <CompN />
</Quicklink>

As for React native, I suppose the philosophy is the same. But the key point is how to collect link urls. Quicklink uses document.querySelectorAll and iterates <a> tags to get prefetch set which seems impossible for React native. But we can try with React.Children.map() to filter urls, in this case, we can make a React native version.

from quicklink.

arximughal avatar arximughal commented on May 18, 2024

@HOUCe This sounds really great. I have an app in react-native which uses a lot of images. Fortunately, I get all the URLs for the images before starting a quiz so this component can really really help in that matter as I won't have to filter URLs. Thanks for the component, I'll definitely check it out 🙂

from quicklink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.