Explorar o código

18 react update and prerender check

asmer hai 3 meses
pai
achega
248b775a88
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/SliderImage.js

+ 6 - 0
src/SliderImage.js

@@ -147,6 +147,12 @@ export default ({images = [], className, onChange, onClick, ref, current:propCur
         }
     }
 
+    if (window.navigator.userAgent.includes('Prerender')){
+        return (<img  src={images[0]} 
+                      alt={`image ${i}`} 
+                        />)
+    }
+
     return (
         <div className={className} 
              style={{cssText: `overflow: auto; overflow-y: hidden; -ms-overflow-style: none; scrollbar-width: none; overscroll-behavior-x: none;`}}