Skip to content

SyntaxError: 'import' and 'export' may only appear at the top level #211

@naisargparmar

Description

@naisargparmar

I am using react 16.8.6. My code is working fine but I am getting syntax error. jsfmt don't support below import code.
exportCsv = () => {
this.setState({ isExporting: true });
import('./exportToCsvV2').then(bundle => {
try {
// some code
} catch (e) {
throw e;
}
});
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions