Optional
getGet children from the element of the exotic component, e.g. other prop for rendering children or render props
search(
<ExoticComponent>
{() => (
<button>
Test
</button>
)}
</ExoticComponent>,
{
component: 'button',
},
{
getChildren: (
element,
) => {
if (element.type === ExoticComponent) {
return [element.props.children()];
}
return defaultGetChildren(element);
},
},
)
Target react element
List of child nodes
Optional
match?: ((element, query) => boolean)Check if the target element is matching for search, e.g.
search(
<ComponentWithCustomClassNameProp
customClassName="foo bar baz"
/>,
{
className: 'bar',
},
{
match: (
element,
query,
) => {
if (element.type === ComponentWithCustomClassNameProp) {
return element.props.customClassName.split(' ').includes(query.className);
}
return defaultMatch(element, query);
},
},
)
Target react element
Current query
Is element matching for current query
Generated using TypeDoc
Additional parameters for searching inside exotic elements