Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use renderToStaticMarkup() on <LazyLoadImage> #90

Open
shadoath opened this issue May 27, 2021 · 2 comments
Open

Unable to use renderToStaticMarkup() on <LazyLoadImage> #90

shadoath opened this issue May 27, 2021 · 2 comments

Comments

@shadoath
Copy link

shadoath commented May 27, 2021

Bug description
When building out a map I'm giving HTML to a marker with a LazyLoadImage. As you can guess only the fallback shows.

To Reproduce

const guideFallBackPic =  'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png'
const photoURL = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png'
const popupHtml = ReactDOMServer.renderToStaticMarkup(
    <LazyLoadImage
      src={photoURL}
      placeholderSrc={guideFallBackPic}
      alt={school.name}
      effect='blur'
      height={'110px'}
      width={'110px'}
      // visibleByDefault={true} // Does not hit fallback if `photoURL` is not valid.
      style={{
        backgroundSize: '110px',
        backgroundImage: 'url()',
      }}
    />
)
return (<div>{popupHtml}</div>)

List any other actions needed to reproduce the issue:
Scrolling within the map does not show any image.

Expected behavior
Expect a way to trigger a callback to load the image.

Screenshots
If applicable, add screenshots to help explain your problem.

Technical details:

  • Package version [1.5]
  • Server Side Rendering? [No]
  • Device [Smartphone]
  • Operating System [Mac OS]
  • Browser [Chrome]
@Aljullu
Copy link
Owner

Aljullu commented Aug 13, 2021

Thanks for opening this issue @shadoath. Unfortunately, I'm not very familiar with ReactDOMServer so I don't think I will be able to fix this in the short term. If you want, feel free to contribute a PR and I will review it.

@romanown
Copy link

this fixed? i need use it with renderToStaticMarkup and ssr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants