#Is it ok to use document.getElementById() ?

74 messages · Page 1 of 1 (latest)

fair urchin
#

I know it is not the best react practice but it would shrink the amount of code I need to write for a specific functionality is I use the native dom api instead of the react refs.
Thanks in advance!

swift garden
fair urchin
fair urchin
swift garden
#

Do what you have to do

fair urchin
#

An authentication form

#

I wanna grab the values only on submit

swift garden
#

Just use the FormData web api

barren junco
#

@fair urchin An advice that helped me alot is to not be afraid of longer codes / larger functions.

fair urchin
fair urchin
swift garden
#

Also depends what you need for the form

fair urchin
#

I need to track the values only on submit

swift garden
#

Does it need to check if the input is correct at any time or only submit

#

Ahh alright uncontrolled it is

#

Seems you got it under control then

barren junco
#

something like onSubmit((e) => myfunc(e))

#

Then extract the values from e

swift garden
#

I believe he’s already doing that

#

Just for preventDefault Atleast

fair urchin
swift garden
#

Fucking autocorrect to Atleast?

#

There’s nothing wrong with using native APIs

fair urchin
#

Yeah, I know

swift garden
#

Depends which ones though as some don’t work too well if done wrong

fair urchin
#

But the docs and some seniors have told me that it is a really bad practice

swift garden
#

Meh

#

Depends, some more depends finally some depends.

#

It’s a very black and white picture your “seniors” are throwing at you lol

#

Maybe they aren’t as senior as you think

fair urchin
fair urchin
fair urchin
swift garden
#

A lot of people are held back by sticking to the easy route, taking the easy way, believing they are always right, instead of going out and experimenting

fair urchin
#

Not in the best way of course

swift garden
#

🤷 I’m just a very curious student

#

Ain’t got no job

fair urchin
#

I am a student as well but with a job

#

I am not the one paying so I can't force my practices onto them

swift garden
#

School is free here 🤘

fair urchin
swift garden
#

A country in Scandinavia

#

The one Lego is from

fair urchin
#

Oo finland ?

swift garden
#

😭

#

👎

#

Denmark

fair urchin
#

joking dude

#

I am not american

#

Don't worry

swift garden
#

Dutch?

#

Or Canadian, likes to joke about their neighbors?

fair urchin
#

Hmm

#

I mean Canadians are polite asf

swift garden
#

So you’re not Canadian

#

French?

#

UK?

fair urchin
#

Balkan

#

Bulgarian to be exact

swift garden
#

Ahh

#

Isn’t that close to Estonia and Latvia

#

Or rather they are in the balkans

fair urchin
#

I live 20 km from the greek border

#

and we are pretty far from the baltic nations

swift garden
#

Duck me, Baltic and balkans

#

👍 we’re on the same page now lol

fair urchin
#

Yeah

#

It was good chatting with you, need to continue on with work.

#

See ya!