My code is getting longer so I decided to transfer them to other javaScript file.
I followed this relevant topic regarding my question but Why I getting an error i just copy and paste everything?
In above link here's the code
//slideshow.js
function plusSlides(n) {
showSlides(slideIndex += n);
}
//Home.js
class NextButton extends React.Component {
constructor() {
super();
this.onClick = this.handleClick.bind(this);
}
handleClick (event) {
script.plusSlides(1); // I don't know how to do this properly...
}
render() {
return (
<a className="next" onClick={this.onClick}>
❯
</a>
);
}
}
This my error "Attempted import error: 'plusSlides' is not exported from '../plusSides file'."
I used react.js CRA is there something i need to configure to fix this?