0
import React, { Component } from 'react';

import { Slider } from 'react-slick';

import Home from './Home.js';
import About from './About.js';

class App extends Component {


  render() {
    var settings = {
      dots:true,
    };
    return (
      <div className='app'>

        <div className='container'>
          <Slider {...settings}>
            <Home />
            <About />
          </Slider>
        </div>

      </div>
    );
  }
}


export default App;

Picture of errormessage

So I cant make my slider work... Even ready examples wont work. Theres picture of error what react throws. Im using create-react-app

vpiili
  • 1
  • 1

2 Answers2

1

Try import Slider from 'react-slick'; (remove the braces)

jbm
  • 1,482
  • 11
  • 26
1

Actually the braces are used when you want to import something specific from the package in your case you can just:

import Slider from 'react-slick';

I hope that helps in understanding what you are doing as well :-)

Mohhamad Hasham
  • 1,750
  • 1
  • 15
  • 18