- First choose an existing react plugin in elektra and add a new folder under widgets with an init.jsx file:
cd elektra/plugins/lbaas2/app/javascript/widgets/
mkdir test
cd test
touch init.jsx- Create a
init.jsxfile with your react application. Ex:
| import React, { | |
| useEffect, | |
| useState, | |
| forwardRef, | |
| useRef, | |
| useCallback, | |
| createRef, | |
| useMemo, | |
| } from "react" | |
| import Select from "react-select" |
cd elektra/plugins/lbaas2/app/javascript/widgets/
mkdir test
cd test
touch init.jsxinit.jsx file with your react application. Ex:Welcome to this exciting exercise where you'll get hands-on experience with JavaScript and Rockets using the SpaceX Open Source REST API. In this exercise, you'll have the chance to interact with data related to launches and rockets. Let's dive in and start exploring!
| const fs = require("fs") | |
| const path = require("path") | |
| const componentsDir = path.join(__dirname, "../src/components") | |
| const indexFilePath = path.join(__dirname, "../src/index.ts") | |
| let componentNames = new Set() | |
| let exportedComponents = new Set() | |
| // Read components from the directory |