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

GlTemplate broken encapsulations #13

Open
garronej opened this issue Apr 24, 2022 · 2 comments
Open

GlTemplate broken encapsulations #13

garronej opened this issue Apr 24, 2022 · 2 comments

Comments

@garronej
Copy link
Collaborator

Encapsulation is broken here

image

should be in charge of reporting the aspect ratio upstream.

@garronej
Copy link
Collaborator Author

useEffect(() => {
const image = document.getElementById(illustrationId);
if (!image || image.clientHeight === 0 || illustration === undefined) {
return;
}
setImageAspectRatio(image.clientWidth / image.clientHeight);
}, [isImageLoaded]);

@garronej garronej reopened this Apr 24, 2022
@garronej
Copy link
Collaborator Author

I uderstand why it's conveignent to do it like that.
We should however use the className to select the component instead of requiring an id to be set. .

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

No branches or pull requests

1 participant