I know there are a lot of similar posts, but none of them seem to be similar to this one.
Using react redux to use mapStateToProps.
in my App.js I use import Score from './components/Score'; in order to import the component.
The component is in a folder called Score, where it contains index.js and Score.js. Inside Score.js I have:
const Score = ({team_score}) => (
<>
<p>{ team_score }</p>
</>
);
export default Score;
Inside my index.js I have:
import { connect } from "react-redux";
import Score from "./Score";
let mapStateToProps = (state) => {
return {
team_score: state.team_score,
};
};
connect(mapStateToProps)(Score)
But I get the error:
./src/App.js
Attempted import error: './components/Score' does not contain a default export (imported as 'Score').
I have triple checked and the file path is correct. I'm not sure why I'm getting this error.