Cansu – 09-32 Oct 29

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 😦
UU
Unknown User537d ago
D
DAMACANSU537d ago
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 😦
D
DAMACANSU537d ago
err log on devtools is cleaner than...
UU
Unknown User537d ago
D
DAMACANSU537d ago
yeah I can even see it in the past commands
UU
Unknown User537d ago
D
DAMACANSU537d ago
indeed. I should try this on a fresh installation I guess
UU
Unknown User537d ago
D
DAMACANSU537d ago
sure thing
UU
Unknown User537d ago
D
DAMACANSU537d ago
hmmmmmmmmmmmmmmmmmmmm
UU
Unknown User537d ago
D
DAMACANSU537d ago
still blank. same code, but latest version.
D
DAMACANSU537d ago
no errs again
UU
Unknown User537d ago
D
DAMACANSU537d ago
indeed, tried npm start and npm run start changed localhost port to empty one too
UU
Unknown User537d ago
D
DAMACANSU537d ago
same result
D
DAMACANSU537d ago
and yeah i changed it
UU
Unknown User537d ago
D
DAMACANSU537d ago
no and inside of root is empty
D
DAMACANSU537d ago
UU
Unknown User537d ago
D
DAMACANSU537d ago
same.
D
DAMACANSU537d ago
it is really weird that I dont even have a swear word to express it
UU
Unknown User537d ago
D
DAMACANSU537d ago
it is getting really weird atm
D
DAMACANSU537d ago
UU
Unknown User537d ago
D
DAMACANSU537d ago
javascript allow (default)
UU
Unknown User537d ago
D
DAMACANSU537d ago
lmao best idea no luck 😦
D
DAMACANSU537d ago
index.html is indeed showed on local host
UU
Unknown User537d ago
D
DAMACANSU537d ago
jetbrains is the best drug in this world
UU
Unknown User537d ago
D
DAMACANSU537d ago
do I need to add <script href="doot"><script> somewhere? I guess render takes care of it
UU
Unknown User537d ago
D
DAMACANSU537d ago
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.
UU
Unknown User537d ago
D
DAMACANSU537d ago
yeah i just installed it copied my old app.js index.js and index.html
UU
Unknown User537d ago
D
DAMACANSU537d ago
dooot
UU
Unknown User537d ago
D
DAMACANSU537d ago
undo-ed
UU
Unknown User537d ago
D
DAMACANSU537d ago
dunno still trying to figure out how to write function
UU
Unknown User537d ago
D
DAMACANSU537d ago
hmmhmmm...
D
DAMACANSU537d ago
DUDE
D
DAMACANSU537d ago
CAN I KISS YOU?
D
DAMACANSU537d ago
AAAAAAAAAA
D
DAMACANSU537d ago
!commands
UU
Unknown User537d ago
D
DAMACANSU537d ago
... !solved ?
UU
Unknown User537d ago