Giter Club home page Giter Club logo

react-image-appear's Issues

loader icon shows

Sometimes it shows the loader icon when the image is already loaded.

caching issue maybe?

Failed to build

npm run -script build

Failed to minify the code from this file:

./node_modules/react-image-appear/src/ReactImageAppear.js:10

Placeholder background appear when using border-radius

File location: ./src/constants.js

I have website with dark background and it's very ugly when the img loads with smoked white background. Also, there is an issue when using ReactImageAppear with mozila firefox. Wen made the img with border radius the placeholder backgroud showing off sides.

Here is a photo of the issue: Link

I bolded the line that I think cousing me problems. I think it will be beneficial for many developers if the placeholder doesn't have backgrond and or if there is posability to change it via props.

PLACEHOLDER_STYLE = {
position: 'relative',
display: 'inline-block',
backgroundColor: '#f0f0f0',
backgroundPosition: 'center center',
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat'

Caching array.map images?

First of all this package stole like 3 hours of my life 😿

Not sure what the issue is and I dont plan to use this package anymore tbh, but when mapping an array of src's to ReactImageAppears if any elements are removed from the array the images do not accurately reflect the change. For example, if I have an array of 3 image src's and delete one, only the last index 'disappears'. It made it seem as if my code was only deleting the last index, when in reality it seems the initial load was cached and if any elements were removed, it still rendered the old values

Failed to minify the code from this file

When I try to build, it says:

Failed to minify the code from this file:
        ./node_modules/react-image-appear/src/ReactImageAppear.js:16

React version: 16.8.3
React scripts: 2.1.1

image

Cannot use import statement outside a module

Hello, I'm creating a blog with React / Next.js.
The problem below occurred when loading images. Is there any idea to solve this?

Error message:

/path/to/node_modules/react-image-appear/src/ReactImageAppear.js:7
import React, { Component } from 'react';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.react-image-appear (/path/to/.next/server/pages/blog.js:751:18)
    at __webpack_require__ (/path/to/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./src/pages/blog/index.tsx:12:76)
    at Object../src/pages/blog/index.tsx (/path/to/.next/server/pages/blog.js:535:1)
    at __webpack_require__ (/path/to/.next/server/webpack-runtime.js:33:42)
    at __webpack_exec__ (/path/to/.next/server/pages/blog.js:815:52)
    at /path/to/.next/server/pages/blog.js:816:28
    at Object.<anonymous> (/path/to/.next/server/pages/blog.js:819:3)
    at Module._compile (internal/modules/cjs/loader.js:999:30)

loader disappear on auto width and height image

any solution for keep the loader shown on auto with and height image? maybe some props to determine if the image already loaded so i can change the width/height to auto from static number

How do you dimension this?

I'm new to ReactJS but I found this component incredibly difficult to style (the resulting image). Might be helpful to add to the readme how to style the image, I could not figure it out so I'm using the regular

onClick prop is not passed down to the <img> element

I was trying to pass an onClick prop down to the underlying element, but looking through the code it looks like the onClick prop is never destructured and passed down. Are there any plans in the future to implement this? I'm happy to open a PR for it if needed.

Image stays the same after src is changed

Probably the component is not reacting to props being changed, so if i use this for a slider or something where the src={} changes, it stays the same. I would say this is a pretty big problem.

Images loaded, loader doesn't disappear.

Hi! I have a problem with this component. the loading gif/placeholder isn't disappearing once the image has loaded.

My steps:

  • Web loads.
  • Async content API request starts.
  • When the content is ready, creates a few ReactImageAppear elements with the API provided src.
  • Loader gif appears.
  • When the image loads, it's placed behind the loader gif.
  • Loading gif doesn't disappear.

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.