Reputation: 2637
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
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