Trying to use this with a table and just regular DIVs for now:
```
import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import { Modal,ModalManager,Effect} from 'react-dynamic-modal';
var Slider = require('react-slick');
class MyModal extends Component{
render(){
const { text,onRequestClose } = this.props;
return (
{
overlay: {
position : 'fixed',
top : 0,
left : 0,
right : 0,
bottom : 0,
zIndex : 99999999,
overflow : 'hidden',
perspective : 1300,
backgroundColor : 'rgba(0, 0, 0, 0.3)'
},
``` content: {
position : 'relative',
margin : '15% auto',
width : '60%',
border : '1px solid rgba(0, 0, 0, .2)',
background : '#fff',
overflow : 'auto',
borderRadius : '4px',
outline : 'none',
boxShadow : '0 5px 10px rgba(0, 0, 0, .3)',
}
}
}}
onRequestClose={onRequestClose}
effect={Effect.Newspaper}>
class JsonTable extends React.Component {
constructor(props) {
super(props);
this.state = {
posts: []
};
}
componentDidMount() {
axios.get(http://www.reddit.com/r/${this.props.subreddit}.json)
.then(res => {
const posts = res.data.data.children.map(obj => obj.data);
this.setState({ posts });
});
}
openModal(){
const text = this.refs.input.value;
ModalManager.open(<MyModal text={text} onRequestClose={() => true}/>);
}
render() {
var settings = {
dots: true,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1
};
return (
<h1>{` prop: ${this.props.subreddit}`}</h1>
<ul>
{this.state.posts.map(post =>
<li key={post.id}>{post.title}</li>
)}
</ul>
</div>
<div><h3>2</h3></div>
</Slider>
</div>
);
}
}
`
Your dependency should be imported like so:
import Slider from 'react-slick';
That worked! Thanks! Great carousel!!
The docs should be updated then, I had this issue too.
Works! please update the docs ;-)
Most helpful comment
Your dependency should be imported like so:
import Slider from 'react-slick';