I am creating the custom paging slider from https://react-slick.neostack.com/docs/example/custom-paging/ I copied the code directly from the website and follow the instructions and installed the packages. When i try to run the code though i get the following error:
./src/Carousel.js Module not found: Can't resolve './config.js' in '/Users/mcoe/Documents/Code/my-app1/src'
Code:
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Style from "react-responsive-carousel/lib/styles/carousel.min.css";
import { Carousel } from 'react-responsive-carousel';
import Slider from 'react-slick';
import { baseUrl } from "./config.js";
export default class SimpleSlider extends React.Component {
render() {
const settings = {
customPaging: function(i) {
return (
<a>
<img src={`${baseUrl}"Random1${i + 1}.png`} />
</a>
);
},
dots: true,
dotsClass: "slick-dots slick-thumb",
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1
};
return (
<div>
<h2>Custom Paging</h2>
<Slider {...settings}>
<div>
<img src={baseUrl + "Random1.png"} />
</div>
<div>
<img src={baseUrl + "Random1.png"} />
</div>
<div>
<img src={baseUrl + "Random1.png"} />
</div>
<div>
<img src={baseUrl + "Random1.png"} />
</div>
</Slider>
</div>
);
}
}