R
Reactiflux

help-threads-react

Cansu – 09-32 Oct 29

DDAMACANSU10/29/2022
Simple as hell render question. Yes I am dumb and yes I started learning react 1 hour ago.
render() {
return (
<div className="App">
<button onClick={this.send}>Hit</button>
</div>
);
}
render() {
return (
<div className="App">
<button onClick={this.send}>Hit</button>
</div>
);
}
this doesnt render anything on
<div id="root"></div>
<div id="root"></div>
https://pastebinp.com/Ce2BJopBs46v4fqLCHIzQ#6bIwGME0hZ4e3l5UwXCQwjjIwyk5erl7zwygDfJcYZw= full app.js code, full index.js code https://pastebinp.com/eb4Lr0rB7zE7MWMJidwiw#2yVSgC1dJLUkFRZr9rvL8NPr4MHiIjdbqLx-7a072AI= help 😦
UUUnknown User10/29/2022
3 Messages Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
erm, I literally know nothing can you please elobarate further?
// App.js
import React, { Component } from "react";
import "./App.css";
import * as ReactDOM from 'react-dom';
import { connect, sendMsg } from "./index";

function send() {
connect();
console.log("hello");
sendMsg("hello");
}
const root = ReactDOM.createRoot(document.getElementById('root'));
const element = `
<div>
<button onClick={send}>Send</button>
</div>
`;
root.render(element);
// App.js
import React, { Component } from "react";
import "./App.css";
import * as ReactDOM from 'react-dom';
import { connect, sendMsg } from "./index";

function send() {
connect();
console.log("hello");
sendMsg("hello");
}
const root = ReactDOM.createRoot(document.getElementById('root'));
const element = `
<div>
<button onClick={send}>Send</button>
</div>
`;
root.render(element);
still blank page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>


</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>


</body>
</html>
root is there too. like why 😦
DDAMACANSU10/29/2022
err log on devtools is cleaner than...
UUUnknown User10/29/2022
2 Messages Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
yeah I can even see it in the past commands
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
indeed. I should try this on a fresh installation I guess
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
sure thing
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
hmmmmmmmmmmmmmmmmmmmm
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
still blank. same code, but latest version.
DDAMACANSU10/29/2022
no errs again
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
indeed, tried npm start and npm run start changed localhost port to empty one too
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
same result
DDAMACANSU10/29/2022
and yeah i changed it
UUUnknown User10/29/2022
2 Messages Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
no and inside of root is empty
DDAMACANSU10/29/2022
UUUnknown User10/29/2022
2 Messages Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
same.
DDAMACANSU10/29/2022
it is really weird that I dont even have a swear word to express it
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
it is getting really weird atm
DDAMACANSU10/29/2022
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
javascript allow (default)
UUUnknown User10/29/2022
2 Messages Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
lmao best idea no luck 😦
DDAMACANSU10/29/2022
index.html is indeed showed on local host
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
jetbrains is the best drug in this world
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
do I need to add <script href="doot"><script> somewhere? I guess render takes care of it
UUUnknown User10/29/2022
6 Messages Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
does this support react? like i am most clueless person atm in frontend Uncaught SyntaxError: The requested module '/src/App.js' does not provide an export named 'default WOOOOOOOOOOOOO I GOT AN ERROR LETS GO but how do i fix this tho.
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
yeah i just installed it copied my old app.js index.js and index.html
UUUnknown User10/29/2022
2 Messages Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
dooot
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
undo-ed
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
dunno still trying to figure out how to write function
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
hmmhmmm...
DDAMACANSU10/29/2022
DUDE
DDAMACANSU10/29/2022
CAN I KISS YOU?
DDAMACANSU10/29/2022
AAAAAAAAAA
DDAMACANSU10/29/2022
!commands
UUUnknown User10/29/2022
Message Not Public
Sign In & Join Server To View
DDAMACANSU10/29/2022
... !solved ?
UUUnknown User10/29/2022
3 Messages Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

help-threads-react

Join Server