Ad

How In Immutable Js I Can Each In Map Method?

- 1 answer

How:

    let type = [ "categories", "people", "organization"];
    let tab = filterCache.map((name) =>
        type.each((i) =>
            <Tab>{name[i]} ({1})</Tab>
        )
    );

This return error : Unexpected token input

Ad

Answer

What about the folllowing snippet?

let tab = filterCache.map((name) =>
    return type.each((i) => {
        (<Tab>{name[i]} ({1})</Tab>)
    });
);

Independently of the library stack you are using the function applied tomaprequires a returnstatement.

Ad
source: stackoverflow.com
Ad