Why so many kinds of import/export on Javascript/Typescript

By Kokizzu

I’m a newbie on server side javascript, I’ve used nodejs before for simple things, but only the default libraries (where I never ever need to use require or import keywords, but lately I’m learning ReactNative/ReactXP I’ve seen:

import RX = require('reactxp');
const popsicle = require('popsicle');
import LoginPage = require("./LoginPage");
import React, { Component } from 'react';
import { AppRegistry, Text } from 'react-native';
import AppState from './AppState';

And exports:

export default Resources; // Resources is an object
export = LoginPage; // LoginPage is a class

The question is, what’s the difference between combination of const-require, import-require and import-from? also what is export= it seems not on the Mozilla’s doc?

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273