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

fix(gallery): fix empty images view #1117

Merged
merged 6 commits into from
Mar 4, 2024
Merged

fix(gallery): fix empty images view #1117

merged 6 commits into from
Mar 4, 2024

Conversation

reabiliti
Copy link
Contributor

Опишите проблему

При передачи пустого массива images и потом при добавлении новых картинок происходит скачек при перерендере

Шаги для воспроизведения

function Example() {
    const [open, setOpen] = React.useState(false);
    const [images, setImages] = React.useState([]);
    
    React.useEffect(() => {
    setTimeout(() => setImages([{ src: '' }]),2000)
    
    }, [])
    return (
        <div>
            <Button onClick={() => setOpen(true)}>
                Нажми на меня
            </Button>
            <Gallery open={open} images={images} onClose={() => setOpen(false)} />
        </div>
    );
}
render(
    <Example />
)

Чек лист

  • Тесты
  • Документация

Copy link

changeset-bot bot commented Feb 26, 2024

🦋 Changeset detected

Latest commit: 5ff2b18

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alfalab/core-components-gallery Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

Copy link
Contributor

@reme3d2y reme3d2y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reabiliti еще нужно changeset добавить

@coveralls
Copy link

coveralls commented Feb 28, 2024

Pull Request Test Coverage Report for Build 8092232665

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 84.548%

Totals Coverage Status
Change from base Build 8060963543: 0.004%
Covered Lines: 9334
Relevant Lines: 10220

💛 - Coveralls

Co-authored-by: Evgeny Sergeev <SiebenSieben@gmail.com>
@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@reme3d2y reme3d2y merged commit cd49741 into master Mar 4, 2024
7 checks passed
@reme3d2y reme3d2y deleted the fix/gallery-loading branch March 4, 2024 12:16
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

Successfully merging this pull request may close these issues.

None yet

6 participants