score:1

because you are doing default export from routes.js file not named export, and importing it as named export.

use this:

import routes from './routes';     //remove {}

score:1

you have used 'export default' in routes.js, this means that to import it you need to use:

import routes from "./routes";

in your code you have used {routes} which would import when exported without the default.

score:4

you are using default export, you need to import it as default (without curly braces):

import routes from './routes';

on the other hand you can use named export and import it by name:

// index.js
export const routes = ...

// routes.js
import {routes} from './routes';

Related Query

More Query from same tag