Comments (11)
I've tracked down part of the problem. It appears that there is a difference between the development and production versions of React itself. React-Slick appears to only have problems with the non-minified version of React.
<!DOCTYPE html>
<html>
<head>
<!-- PRODUCTION WORKS-->
<!--<script src="https://fb.me/react-0.13.2.min.js"></script> -->
<!-- DEVELOPMENT FAILS -->
<script src="https://fb.me/react-0.13.2.js"></script>
<script src="/bower_components/react-slick/dist/react-slick.js"></script>
</head>
<body>
<div id="example">[loading...]</div>
<script>
React.render(
React.createElement(Slider, null,
React.createElement('div', null, 'first')),
document.getElementById('example'));
</script>
</body>
</html>
from react-slick.
I'm seeing the same behaviour with react-slick 0.4.1 and react 0.13.3, with both the minified and unminified versions.
from react-slick.
I have same issue with react 0.13.2
from react-slick.
Better solution than using the dist file from installed package is to proper configure the webpack to require base slider.jsx file. Due the other issues with this configuration, this definition works for me in webpack.config.js as a new loaders entry:
{
test: /\.jsx$/,
loaders: ['babel']
}
from react-slick.
@vaclavh You needn't use dist files
If you are using webpack, you can do
var Slider = require('react-slick')
from react-slick.
I don't see this issue on latest release.
@vaclavh @lewismoten @edoloughlin Can you guys check this issue on the latest release ?
Alternatively clone this gist and https://gist.github.com/vramana/e6d040d0bd9f19ae6d72 and run npm start
and report if you see any errors ?
from react-slick.
I see the issue when adding dynamic slide.
let arr = this.state.arr;
arr.map((item, index)=><div key={item+index}><h3>{item}</h3></div>)
return (
<div>
<Slider>
{arr}
</Slider>
<button onClick={this.addMore}>add more</button>
</div>
);
from react-slick.
@awartani Can you give more information ?? Are you using the dist files ?? Also can you post the complete log ?
Don't insert any keys slick
automatically inserts keys for you.
from react-slick.
arr.map((item, index)=><div key={item+index}><h3>{item}</h3></div>)
@awartani It is a plain javascript error. Arrap.map returns a new array so you have use new variable to store it and put it inside the Slider
from react-slick.
Thanks @vramana, after fixing that, the issue is gone.
from react-slick.
@awartani You are welcome.
from react-slick.
Related Issues (20)
- Forcing slide animation when scrolling up and down on mobile
- Slider isn't aligned left HOT 4
- Change width of the center slide only
- Performance issue with clones (infinite)
- initialSlide is ignored on breakpoints HOT 1
- currentSlide from afterChange event shows decimal when using SlidesToShow as decimal and infinite:false
- autoplay does not work when PauseOnHover, pauseOnFocus, and pauseOnDotsHover are all true
- Unexpected Behavior in Vertical Mode Swipe HOT 6
- Link Css file not working in Nextjs HOT 10
- Slick Infante is not working HOT 1
- If used infinite, speed will not work
- IOS 14 and up - slider won't scroll on drag
- Get offsetWidth of element in slick-track
- Upgrade to react 19 HOT 1
- React-slick issue HOT 1
- dots are coming as numbers
- asNavFor behavior change after 0.30 release
- I have only one slide and its replicate the inner content three times HOT 6
- Prop "slide" seems not to work
- bug with aria-hidden
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-slick.