react-awesome-slider
react-awesome-slider copied to clipboard
startupScreen component
Hello to everyone.
I use this amazing slider with a navigation strategy HOC.
I created a preload component <Preloader/>
and I want it to render like a startup screen. I tried to insert it into the media array, but it doesn’t work as it is required, it just creates an additional slide and it works with options startup: false;
flag.
when the startup
flag is true, throws an error: Uncaught TypeError: Cannot read property 'slug' of undefined.
`const SSlider = () => { const NavigationSlider = withNavigationHandlers(AwesomeSlider);
const sT = {
className: "",
duration: 500,
speed: 1500,
bullets: true,
bulletsHeigth: 2,
startup: false,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
adaptiveHeight: true,
scrollable: true,
draggable: true,
resizable: true,
};
return (
<NavigationSlider {...sT}
startupScreen={<Preloader/>}
media={media}
/>
)
};
export default SSlider;`
`const App = () => { const slug = "[THE INITIAL RENDERED SLUG]";
return (
<Provider slug={slug}>
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo"/>
</header>
<NavigationSlider/>
<Burg/>
</div>
</Provider>
)
};
export default App;`