amsul / amsul/react-translated

Return string to object

Open
#14 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
176
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Hi, I have Dropdown component with filtering.
I'm getting data for the component from ...

clubs = dataClubs.map((item) => {
return ({
value: item.id,
label: ``
});
});

Displaying a component is OK, but if I start filtering over the data, an error message will be displayed:
TypeError: option.label.toLowerCase is not a function

I tried to use "getTranslated" and work, but I must put in params language and translation.
Is it possible to add something like `,` where the parameter will be just text?

That you very much for help.

Ales

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.