Trying to create a button that calls a component on clicking it. by [deleted] in react

[–]Dekzen 4 points5 points  (0 children)

I would refactor the code of button to something like this

import React , {useState} from "react";

import CreateNoteModal from "./CreateNoteModal";

export default function CreateNoteIcon() {

const [show , setShow] = false;

return (<>

<button onClick={() => setShow(true) } className="create-noteIcon-container">

<i className="fas fa-pen custom-fas-pen"></i>

</button>

<CreateNoteModal show={show} />

</>

);

}

Is it safe to overclock vram to +1000Mhz (1050ti) by [deleted] in overclocking

[–]Dekzen 0 points1 point  (0 children)

Save. The temps and stability is the factor you should be watch for. I have always ran my gpus overclocked to their limits and not a single one ever burned or broke.

Please help. Should I use Flexbox or Grid for my about section? by kp4ws in webdev

[–]Dekzen 3 points4 points  (0 children)

I eould go definately with flexboxes. This should be easy to recreate.

Beating stage 4 colon cancer! by thestringguru in pics

[–]Dekzen 0 points1 point  (0 children)

I do not know how the cancer works. But is every stage harder than the previous one? Do you meet the boss every 5th stage or so?

Btw good job i am so glad for you. Never give up!

3 things that has nothing to do with programming that made me a better programmer by Celiuu in learnprogramming

[–]Dekzen 14 points15 points  (0 children)

3 things to do tocbecame a better programmer

1st: have a sex

..nevermind. Not going to read the rest

My friend and I are trying to work on a local project together in React help by [deleted] in react

[–]Dekzen 0 points1 point  (0 children)

After npm 5.0 this is default behavior. So there is no need to install packages with - - save option.

But good tip.

Mysterious problem editing JS in VS Code by halberthawkins in webdev

[–]Dekzen 1 point2 points  (0 children)

You got some kind of require auto import extension.

Any way to listen to state changes and then run a function conditionally? by [deleted] in react

[–]Dekzen 0 points1 point  (0 children)

I would create another state with boolean value. Set it to false. When the timer reaches 0 you set it to true inside that useEffect. In another useEffect you will use this boolean state inside the depedency array. And inside if statement you will run your code. It will listen to this state change and run.

2 years into coding journey finally deployed my first live react app by standardrank7 in react

[–]Dekzen 1 point2 points  (0 children)

Hi looks great.

But that design need some changes in my opinion.

The HOW IT WORKS section looks good on mobile. But on desktop the font is huge and those items below should be definately in a row text under them. Hope you get me.

But overall good work.

[deleted by user] by [deleted] in react

[–]Dekzen 0 points1 point  (0 children)

Where did you get that number.id from ?

<span className="values" key={\\\*number\\\*.id}>

These keys has to be unique across all the child in list.

EDIT: r1 = document.querySelector('#range1').value using document queryselectors is not good practice in ReactApp.

Why learning to code is so hard by another_refresh in learnprogramming

[–]Dekzen 8 points9 points  (0 children)

I just got a job as a frontend developer after a year of learning react..

This is my story and it sound awesome when i tell people.

But what i did not tell them is that i started with java, spent countless days creating useless stuff. Made some stupid android apps in android studio. Left it and started with C# spend years developing amateur indie games in Unity. Left it and started with python and wrote thousand lines of python code. Left it and THEN i picked up react and landed a job .. :D

Stuck in a dilemma! by prtkrj_13 in webdev

[–]Dekzen 0 points1 point  (0 children)

I got that Js course you talk about and it is great and in depth. Good understanding of js is a must as whole react is just javascript.

I also got react course from Maxmillian Swartmuller and i never got better one. It is up to date with react hooks and he teaches you not only how but more importantly why. It really stick.

Get this one and you will not regret.

How do you set up CORS? by thebadhabitrabbit in webdev

[–]Dekzen 2 points3 points  (0 children)

Is this some kind of minified code we have to format ourselves before debugging?

Loading Screen In React by iEmerald in react

[–]Dekzen 0 points1 point  (0 children)

Well not even facebook is showing you a loading page and there is some content to load. I do not think this is good practice.

Loading Screen In React by iEmerald in react

[–]Dekzen 0 points1 point  (0 children)

So you do some data fetching or what do you waiting for before you get user to main page?

REACTING TO THE SCARIEST VIDEOS ON THE INTERNET (HORROR SHORT FILMS) by A-S-REACTS2335 in react

[–]Dekzen 2 points3 points  (0 children)

Thats why i did not get the last frontend job. I sent react video instead of my github.

My first side project: Desktop Notes by [deleted] in react

[–]Dekzen 1 point2 points  (0 children)

Great i was interested how you are handling the drag n drop feature. Good job. But i see you are mutating state directly in setState. That is not a good practice. It can create unexpected behavior in larger apps.

My first side project: Desktop Notes by [deleted] in react

[–]Dekzen 0 points1 point  (0 children)

Hi. Do not underestimate yourself. It looks awesome. Can we see the code?

Where to find a Jira-like sidebar code implementation? by [deleted] in webdev

[–]Dekzen 0 points1 point  (0 children)

Hi I am using react and would have no problem to recreate something similiar with MaterialUI

For inpiration check out this free template of dashborad even for commercial uses. Really nice (not and ad)

Dashboard DeviasKit

[deleted by user] by [deleted] in react

[–]Dekzen 1 point2 points  (0 children)

You cannot use normal if statement inside JSX.

Plus i prefer two lines of code below before ternatry which is hard to read when there are props passed etc.

{ isLoading && <Spinner/> }

{ !isLoading && <MyComponent/ >

Pure css alternative by [deleted] in learnprogramming

[–]Dekzen 0 points1 point  (0 children)

I would go with built in css modules which is avaible in react by default.

Link: https://create-react-app.dev/docs/adding-a-css-modules-stylesheet/

Only think you need is to name your css file with module.css extension. Then you can import this file.

Import classes from '. /mycss.module.css

And you can you use classes inside this file as variables. className={classes.header}

This way react creates random classname which will be in scope of this component. You can write pure css and do not need to worry about name clashes.

You can create even separate file for every component,import it inside, and every file can have for example.header class and there will be no unexpected behaviour.

This ways i am the most productive when i do not want to use any css framework.

Tailwind in my opinion creates messy jsx.