Coder Social home page Coder Social logo

react-progressive-image-loading's People

Contributors

wcandillon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-progressive-image-loading's Issues

Can you please update to fix componentDidMount warning

I'm getting this
`Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.
  • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: ProgressiveImage`

Can you please update or guide me to update to make it work forever

Thanks

Full image to be in viewport

Hi,

See the code sample at https://codesandbox.io/s/m94pp34x9y
Until the entire image do not come under the viewport, the actual image wont get loaded. Can you please help how to fix this?
For me it either looks like I am missing something or there is issue with the framework.

The actual behavior should have been that as soon the top of the image enters the viewport, the actual image should get loaded up.
bug

Images doesnot change dynamically.

I tried to change images dynamically everytime the next button is pressed. But not changing.
This is what I'm doing. Any help will be appreciated. Thanks

<ProgressiveImage preview={this.getThumbnail(step)} src={this.getImage(step)} render={(src, style) => <div className="d-flex flex-column" style={Object.assign(style, { backgroundSize: 'cover', backgroundPosition: 'center', height: '100vh', position: 'relative', backgroundImage: url(${src}), zIndex: 999 })}>

Can't call setState (or forceUpdate) on an unmounted component.

First off, thanks a ton for creating this helpful tool!

I've noticed that if the full image (src) hasn't rendered and you switch the route / component of the application, you will be met with this warning in the console...
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

I'm thinking it has to do with the functions running this.setState... -- any ideas on how to resolve this so these warning don't pop-up?

Catch loading errors

Hi, thanks for this awesome component !

How can I handle loading errors (eg: bad URL) ?

hey man , is does'n work ! ... how ?

import ProgressiveImage   from "react-progressive-image-loading";
 <ProgressiveImage
          preview="/src/preview.jpg"
          src="/src/bk-1.jpg"
          transitionTime={500}
          transitionFunction="ease"
          render={(src, style) => <img src={src} style={style} />}
        />

warning.js:35 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of MyComponent.
in MyComponent
printWarning @ warning.js:35
warning @ warning.js:59
createElement @ ReactElementValidator.js:192
render @ index.jsx:30
(anonymous) @ ReactCompositeComponent.js:795
measureLifeCyclePerf @ ReactCompositeComponent.js:75
_renderValidatedComponentWithoutOwnerOrContext @ ReactCompositeComponent.js:794
_renderValidatedComponent @ ReactCompositeComponent.js:821
performInitialMount @ ReactCompositeComponent.js:361
mountComponent @ ReactCompositeComponent.js:257
mountComponent @ ReactReconciler.js:45
performInitialMount @ ReactCompositeComponent.js:370
mountComponent @ ReactCompositeComponent.js:257
mountComponent @ ReactReconciler.js:45
mountComponentIntoNode @ ReactMount.js:104
perform @ Transaction.js:143
batchedMountComponentIntoNode @ ReactMount.js:126
perform @ Transaction.js:143
batchedUpdates @ ReactDefaultBatchingStrategy.js:62
batchedUpdates @ ReactUpdates.js:97
_renderNewRootComponent @ ReactMount.js:319
_renderSubtreeIntoContainer @ ReactMount.js:401
render @ ReactMount.js:422
./src/index.jsx @ index.jsx:54
webpack_require @ bootstrap 195e962419c58229becf:676
fn @ bootstrap 195e962419c58229becf:87
0 @ bundle.js:45254
webpack_require @ bootstrap 195e962419c58229becf:676
./node_modules/@blueprintjs/core/dist/accessibility/focusStyleManager.js.Object.defineProperty.value @ bootstrap 195e962419c58229becf:722
(anonymous) @ bootstrap 195e962419c58229becf:722
invariant.js:44 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of MyComponent.
at invariant (invariant.js:44)
at instantiateReactComponent (instantiateReactComponent.js:74)
at instantiateChild (ReactChildReconciler.js:44)
at ReactChildReconciler.js:71
at traverseAllChildrenImpl (traverseAllChildren.js:77)
at traverseAllChildrenImpl (traverseAllChildren.js:93)
at traverseAllChildren (traverseAllChildren.js:172)
at Object.instantiateChildren (ReactChildReconciler.js:70)
at ReactDOMComponent._reconcilerInstantiateChildren (ReactMultiChild.js:185)
at ReactDOMComponent.mountChildren (ReactMultiChild.js:224)

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

I have been through most progressive image loaders, I find this one the most convenient. However, I am finding it difficult to use. What am I doing wrong?

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of `Cover`.
import React from 'react'
import ProgressiveImage from 'react-progressive-image-loading';

const Cover = (props) => {
	const CoverStyle = {
		height: "70vh",
		backgroundSize: 'cover',
		backgroundPosition: 'center center'
	}

	return (
		<ProgressiveImage
			preview={props.img_compressed}
			src={props.img}
			render={(src, style) => <img src={src} style={CoverStyle} />}
		/>
	)
};

export default Cover

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.