Jose Cabrera Zuniga
Jose Cabrera Zuniga

Reputation: 2637

importing all functions and constants from another jsx file

I want to create a jsx file that will have several functions/constants that I will like to use in other jsx files. How can I do to import all those functions and constants from that file?

Upvotes: 0

Views: 189

Answers (1)

korgara
korgara

Reputation: 359

Just write that function as 'export function funcName() { ...code }' and import it as '@import { funcName } from 'name of folder with index.jsx file ' ' Or '@import * as common from '/way' And then u should get your const as common.varname

Upvotes: 1

Related Questions