Giter Club home page Giter Club logo

Comments (10)

bluebill1049 avatar bluebill1049 commented on May 28, 2024 1

I will take a look the provider issue soon over the weekend. To be honest i probably need to update the context API too.

from react-simple-img.

yusinto avatar yusinto commented on May 28, 2024 1

from react-simple-img.

millette avatar millette commented on May 28, 2024

I tried with initSimpleImg() running top-level in Page.js and separately in User.js. It works perfectly using Gatsby v2 in dev, but when I build it, the images only update if I start on Page, not if I first load another page.

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 28, 2024

Hi @millette i have updated with a patch to fix the provider bug :)

from react-simple-img.

millette avatar millette commented on May 28, 2024

I just upgraded my project with the patch version and it broke on my end. For example: https://github.com/millette/gatsby-starter-location-github/blob/master/src/components/github-user.js#L8

I moved the init call to the page component (pages/index.js) and contrary to previous version, I was not getting observer errors when I split SimpleImg and initSimpleImg to 2 files, but now, in either case, the images aren't getting loaded, only the gradient placeholder is shown.

from react-simple-img.

millette avatar millette commented on May 28, 2024

Don't worry too much about my comments, as I said, I'm just getting started with Gatsby and my React Fu isn't the greatest either. Also, I found out gatsby has it's own image lazy loader, but I'm not 100% sure it would be effective in my case.

I found using your component to be very simple and effective. For instance, this turned out rather well: https://rollo-venezuela-wtmknramwg.now.sh/ :-)

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 28, 2024

hey @millette,

lovely demo! i am glad it worked for you! i checked your code for working on per component you probably should use provider. but if it worked for you with previous patch, that's all it matters. 😄

thanks
bill

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 28, 2024

ok i have made a new patch this should be fixed now (1.3.16), going to close the issue in the next couple days, if nothing reports :) thanks

from react-simple-img.

millette avatar millette commented on May 28, 2024

Looking good on my end. As I mentionned, last patch broke it for me, but with this one, my project works again. Thanks!

P.S.: I will eventually revisit my code to make proper use of provider.

from react-simple-img.

bluebill1049 avatar bluebill1049 commented on May 28, 2024

👍 thanks @millette

from react-simple-img.

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.