yandex / reselector

Use React Components in css selectors
https://npm.im/reselector
Other
44 stars 10 forks source link

Component with custom DOM node #47

Closed Hurtsok closed 5 years ago

Hurtsok commented 5 years ago

If we make component like this:

type IProps = {
    tag: 'div' | 'h1' | ...
}

export function Component({
    children,
    tag: Wrapper = 'div',
}: IProps) {
    return (
        <Wrapper>
            {children}
        </Wrapper>
    );
}

And then try to grep it using helper select, we don't find it, because helper search by [data-tid=""] but attribute on our node is [data-tid-prop=]