React-slick: React.createElement: type is invalid -- expected a string but got :object

Created on 8 May 2017  路  4Comments  路  Source: akiran/react-slick

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 (
style={{content:
{
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}>


Source:



{text}



);
}
}

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>
);

}
}
`

Most helpful comment

Your dependency should be imported like so:
import Slider from 'react-slick';

All 4 comments

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 ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

artemidas picture artemidas  路  4Comments

amishPro picture amishPro  路  3Comments

PolGuixe picture PolGuixe  路  3Comments

ramyatrouny picture ramyatrouny  路  3Comments

vugman picture vugman  路  3Comments