UNPKG

react-awesome-slider

Version:

React Awesome Slider is a 60fps performant, extendable, highly customisable, production ready React Component that renders a media (image/video) gallery slider carousel.

25 lines (21 loc) 598 B
import React from 'react'; import withNavigationContext from './withNavigationContext'; export default withNavigationContext( ({ fullpage, children, href, className = null, ...extra }) => { const { navigation, navigate } = fullpage; const handleClick = event => { event.preventDefault(); if (navigation.navigating === false) { navigate({ ...navigation, goto: href.replace(/^\//, ''), }); } }; return ( <a className={className} onClick={handleClick} href={href} {...extra}> {children} </a> ); } );