F
F
FishInWeb2021-04-19 16:14:26
Layout
FishInWeb, 2021-04-19 16:14:26

Hide blocks if they don't fit completely in the parent (React)?

Good afternoon everyone! The question is. I have such a page written in React, each record block is a separate component. From the server I receive the list of records. How do I find out how many record blocks fit in the parent in order to render them. For example: on the screenshot, 5 records come to me from the server, only 2 whole records are placed in the parent block (if the page is stretched, it should fit more), and therefore "3 more records" are written, if 3 records fit, then the inscription would be "more 2 records". Thank you all in advance!

607d806e18483509454596.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tehfreak, 2021-04-19
@FishInWeb

This package should help: react-truncate-list .
There is a suboptimal solution, but it is quite enough for lists with a small number of cards.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question