DEV Community

alireza valizade
alireza valizade

Posted on • Originally published at Medium on

6 3

Rendering images smoothly using React Hooks

simple hook to render images smoothly.

In this article I’m going to create very simple Hook to render images smoothly on the screen (Not really rendering but sort of trick).

  1. Create a file “useImage.js” and wrap it with “Hooks” directory with these contents:

This is very basic hook you can add your own stuff, it depends on your needs, like handling errors or whatever which is related to image.

  1. Let’s add some styles to handle the transitions:

  1. I’m going to create a “Cover” component to reuse it everywhere.

Let’s see the result.

Demo Time

Check it out on Sandbox

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)