简体   繁体   中英

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?

只需将该函数写为'export function funcName(){... code}',然后将其从'带有index.jsx文件的文件夹的名称中'@import {funcName}导入,或者将'@import *从'/方式”,然后您应该将const设为common.varname

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM