laurenashpole / react-inner-image-zoom

A React component for zooming images.
https://laurenashpole.github.io/react-inner-image-zoom
MIT License
325 stars 36 forks source link

className template strings can result in excess whitespace when optional classes are not required #98

Closed MaxdAyala closed 2 years ago

MaxdAyala commented 2 years ago

IIZ V3

The className strings use template strings to include optional classes.

The way the template strings are written at the moment results in excess whitespace at the end of the string if optional classes are not needed. This could be 1 or more space characters.

While this doesn't cause any HTML errors the resultant strings look a bit odd when used for server side rendering.

I've tried out a fix by refactoring the template strings.

Files affected: InnerImageZoom.js, Image.js, ZoomImage.js

laurenashpole commented 2 years ago

This doesn't impact functionality at all and seems like a question of personal preference so I'll be closing the issue.