Code Monkey home page Code Monkey logo

Comments (9)

SeinopSys avatar SeinopSys commented on June 19, 2024 1

That's not TypeScript though. I created a CodeSandbox link which shows the issue: https://codesandbox.io/s/react-image-lightbox-typescript-error-cn3hw?file=/src/LightboxExample.tsx

The loader prop is not recognized by TypeScript due to that property missing from the interface inside index.d.ts in the root of the project.

from react-image-lightbox.

dmoli avatar dmoli commented on June 19, 2024

@ray-su did you can add a custom image?

from react-image-lightbox.

ray-su avatar ray-su commented on June 19, 2024

@kaizenberg I didn't. If I remember correctly, the loading spinner is not a looping gif. it's made using CSS transform.

from react-image-lightbox.

3nvi avatar 3nvi commented on June 19, 2024

Any progress on that? From my perspective i'd love to be able to provide a react element as a custom loader. Like so:

<Lightbox
  {...otherProps}
  spinner={<MyCustomLoader />}
/>

from react-image-lightbox.

fritz-c avatar fritz-c commented on June 19, 2024

This is a good candidate for a pull request.

from react-image-lightbox.

mik639 avatar mik639 commented on June 19, 2024

Hi guys, I have pr for this :) #125

from react-image-lightbox.

borisrorsvort avatar borisrorsvort commented on June 19, 2024

@wuweiweiwu @fritz-c Any update on this? Can you tell us what to do/expect?

from react-image-lightbox.

SeinopSys avatar SeinopSys commented on June 19, 2024

Seems like this was implemented in #385 but the TypeScript type definitions weren't updated, so attempting to use the loader property results in a type error.

from react-image-lightbox.

 avatar commented on June 19, 2024

Hello @SeinopSys,

Can you explain a bit more the issue? When I try to implement a custom loader component, by using the loader={}, I get no error at all. <Lightbox... loader={<Test/>}/>

With my test component being:

const Test = () => { return ( <div style={{...}}>Loading...</div> ); }

Result I get:
Screen Shot 2021-09-17 at 9 45 48 AM

from react-image-lightbox.

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.