Skip to content

'Recent Searches' example flips history order on every re-render #438

@alexnaglotech

Description

@alexnaglotech

The Recent Searches example given in the how-to guides uses .reverse() which reverses the array in place. This means on every render (ie. each letter typed) the order of recent searches gets flipped. An easy way around this is to use .toReversed() to create a new instance of the array in reverse order, with the caveat that this is only supported in browsers from ~2023 onwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions