Can you please tell me how to use consts from different JS files in React. I'm trying to calculate a total score of 4 different Quiz scores (Average).

Thank you !

I did try to export and import but didn't work.

Here is the code I'm working on for the first quiz :

```
const playerStatsEco = {
    ecoscore: null,
    numberOfQuestions: null,
    numberOfAnsweredQuestions: null,
    correctAnswers: null,
    wrongAnswers: null,
};

class playeco extends Component {

...

endGame = () => {
        alert('Le quiz est terminé ! لقد انتهى الاختبار');
        const { state } = this;
        playerStatsEco.ecoscore = state.ecoscore;
        playerStatsEco.numberOfQuestions = state.numberOfQuestions;
        playerStatsEco.numberOfAnsweredQuestions = state.correctAnswers + state.wrongAnswers;
        playerStatsEco.correctAnswers = state.correctAnswers;
        playerStatsEco.wrongAnswers = state.wrongAnswers;

    setTimeout(() => {
        this.props.history.push('/play/sum', playerStatsEco);
    }, 1000);
};

```

When I try to export the class, it works. But when I try to export the const as well using this line

```
export  {playeco, playerStatsEco};

```

This error happens :

Attempted import error: './components/quiz/playeco' does not contain a default export (imported as 'playeco').