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;

错误信息的图片

所以我不能让我的滑块工作......即使是现成的例子也行不通。有反应引发的错误图片。我正在使用 create-react-app

4

2 回答 2

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

于 2017-08-21T06:48:37.060 回答
1

试试import Slider from 'react-slick';(去掉括号)

于 2017-07-13T18:41:18.743 回答