This is simple react component for loading assets. It allows you to load from a single asset to multiple assets without affecting the pageload speed. You can also add custom classes, attributes and callback functions.
We all get scared of heavy websites, there are tons and tons of articles telling us why we shouldnt build websites using heavy assets like videos or gifs. But sometimes, you just need to, sometimes you just need to build a cool interactive experience with videos, or so something cool with gifs, or a long page with lots of high quality images, etc. This component is precisely for that.
How it works
This component allows you to load all the assets you want without affecting the pageload speed, this is because it will load the page and then it will start loading all the assets, it adds a
<div className=loading></div> wrapper while its loading the asset so you can have a nice custom loader, when the assets are loaded it will replace the loading wrapper with the actual assets.
Or just grab the component
LoadAsset.js directly from the repo.
Load a single asset.
Load multiple assets.
When you need to load more than one asset for one experience. It will be loadad after all the assets passed are loaded.
You can add classes to each asset you pass to the component.
You can also add attributes to each asset you pass to the component.
Custom onLoad callback.
You can have a custom callback for when your assets are loaded.