I have the following structure of the project:
Files:
I already made the connection between them, my question is, I want to retrieve specifics response from each module in my bot modules, ie:
async function login(page) {
await page.goto(LOGIN_PAGE);
await page.waitFor("#loginForm");
await page.type(NAME, "USER");
await page.type(PW, "PASSWORD");
await page.click(SUBMIT);
var Data = [
...document.querySelectorAll(
"#data"
)
];
}
I want to render the var Data in:
React file:
import React from "react"
const Header = () => (
<div className="header-content">
HERE
</div>
)
And in my index.js (Express server) render directly the index.html generated by gatsby :
app.get("/home", (req, res) => {
res.sendFile(path.join(__dirname, "/client/public/index.html"));
});
Is possible pass the data on this way or there's other correct and possible way to made it?
I don't know to much about how express works with react, thanks for read.
Regards, Luis.
Maybe u can use the following options.
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.