ramda APIs
- equals
- curry
- filter
- prop
- compose
- isEmpty
- always
- map
- cond
- pick
- path
- toPairs
- complement
- isNil
- reject
- reduceBy
- split
- values
- pipe
- either
- ifElse
- keys
- propEq
- assoc
- pluck
- is
- unless
- __
- identity
- o
- when
- not
- flatten
- sort
- test
- head
- contains
- reduce
- anyPass
- nth
- both
- concat
- useWith
- of
- splitEvery
- includes
- without
- intersection
- any
- applyTo
- difference
- identical
- pathEq
- clone
- groupBy
- hasPath
- propOr
- pathSatisfies
- pipeWith
- uniqBy
- lte
- and
- has
- mapObjIndexed
- indexBy
- defaultTo
- chain
- differenceWith
- andThen
- dissoc
- join
- mergeAll
- or
- into
- descend
- pathOr
- indexOf
- T
- fromPairs
- omit
OtherRelated APIs
ramda#contains JavaScript Examples
The following examples show how to use
ramda#contains.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActiveLink.jsx From botble-graphql-next with MIT License | 6 votes |
![]() ![]() |
ActiveLink = ({children, activeClassName, exact, ...props}) => {
const {pathname, asPath} = useRouter();
const child = Children.only(children);
const childClassName = child.props.className || '';
const className = do {
const className = clsx(childClassName, activeClassName);
if (exact && props.as) {
if (contains(props.as, asPath.replace(/[\?#].*/, ''))) {
return className;
}
return childClassName;
}
return pathname === props.href ? className : childClassName;
};
return (
<Link {...props}>
{React.cloneElement(child, {
className: className || null,
})}
</Link>
);
}