Co2p Co2p - 6 months ago 24
React JSX Question

const arrow function can't access imports

Why is User not defined in the springboard function?

springboard is called

in a React router Route.

import User from '/imports/api/user.js';

const springboard = (nextState, replace, callback) => {

Snippet from User:

User = {
get: function() {
return Meteor.user() || {};


You have to export the object that you want to import:

export default {
  get: …

Note that the name of the exported object doesn't matter. You can give it any name, e.g., User when importing.