Open romanown opened 3 years ago
can You apply this changes? https://github.com/ganlanyuan/tiny-slider/pull/479 it helped me for server side rendering, but i can not import.
I used https://github.com/gregberge/loadable-components to load it up and it to work for building
Thanks @bmediax, inspired by the lib you point out I solved my issue using a dynamic import
useEffect(() => {
import('tiny-slider').then(({ tns }) => {
tns(options)
})
}, [])
Dear Team I am getting a page flicker when i import using useEffect hook i hope this issue will be fixed any collaborations i can help with. Thank you
in angular SSR, for me what worked was:
import('tiny-slider').then((module) => {
const { tns } = module.default;
tns();
});
Issue description: (/var/www/dev/desktop/node_modules/tiny-slider/dist/tiny-slider.js:3208:3)
when compled
Demo link/slider setting:
ReferenceError: window is not defined at /var/www/dev/desktop/node_modules/tiny-slider/dist/tiny-slider.js:2:11 at Object.
Tiny-slider version: 2.9.3 Browser name && version:
OS name && version:
I use server side rendering on node.js + react.js. import { tns } from 'tiny-slider';
may be need add to tiny-script
if (typeof(window) !== 'undefined')
UPDATE: i find https://github.com/ganlanyuan/tiny-slider/pull/479/commits/935f8e6231fa1cf9eebfe5b61669b86dab31e5b2 but i do not find this in current code of slider