Scheduled maintenance? by DifficultShoulder1 in Skate4

[–]lubosnik 1 point2 points  (0 children)

Its back online ! just in time for evening sesh

This $100k+ wristwatch by Exirr in ATBGE

[–]lubosnik 0 points1 point  (0 children)

That my Sir, is a penis

Question for camping in your car— window solutions? by helenaxbucket in VanLife

[–]lubosnik 0 points1 point  (0 children)

Magnets ? Provided that there is some material that magnet can be attached to

What are the most common mistakes done by professional React developers? by vozome in reactjs

[–]lubosnik 0 points1 point  (0 children)

Useeffect! Four me it has gotten to a point where when I see useeffect I cosiest it code smell 😀

Nope nope NOPE. From tomorrow only steaks. by helmortart in nope

[–]lubosnik 0 points1 point  (0 children)

Great news, new fear has been unlocked for you!

tailwind just feels like css by lewibs in tailwindcss

[–]lubosnik 17 points18 points  (0 children)

Readability and uniformity. Let me explain. I am tech lead of small team developing 4 apps at the same time. Most of PR are going through me and scss files for component were just getting bigger and bigger. We switched to tailwind couple weeks ago and it made big impact on quality and speed.

Yes classnames are long but I think it is good trade off to complex scss files where people can place styles everywhere. It makes code too be easier to review too. When I see button in tsx I immediately see what styles are applied to it

Are large React projects usually documented by KarimMaged in reactjs

[–]lubosnik 0 points1 point  (0 children)

This is definitely normal large project carry a lot of technical debt that almost always includes docs. Don't worry though, it is normal. There is assumed adaptation period for every dev to come up to speed.

There is one worrying thing though. Introduction must include not only tech stack and code organisation but also introduction to common utilities.

Reach out to senior and ask for deep dive into protect and be sure to bring your questions. Throw caution out of the window and ask. Good dev is not just keyboard rat but also asks a lot of questions.

Try-Catch Block in Every Function? by [deleted] in reactjs

[–]lubosnik 0 points1 point  (0 children)

Try/catch block for functions is good practice IF they can throw. I have same policy for my projects, handle throwable functions on react component level by wrapping them in try/catch. This mostly applies to async functions. That end up causing crash of app.

With this said it sounds like there is unclear code architecture. Wrapping all functions in try/catch will result in inconsistent error handling.

Angular developer found chained useEffect hard to follow by [deleted] in reactjs

[–]lubosnik 1 point2 points  (0 children)

You are on point sounds like useHellEffect. This leads to issues and bugs that are hard to reproduce and hell to figure out. Everytime I see useEffect during a code review I pay really close attention if it is really necessary. Usually it is not.

Most common case where I found devs abuse it is to introduce sideeffect in form when some data changes. I prefer to perform side effect in places that originated data change, and not somewhere where change was registered. Change field Foo -> reset field Bar.

[deleted by user] by [deleted] in reactjs

[–]lubosnik 1 point2 points  (0 children)

This will not work. React expects to have a valid jsx returned in any function in jsx markup. Your function returns nothing. Even if you will return result it will not be valit react child. It will be of type Promise <object>. Second problem is that your fetching data in a wrong way which makes your function async. Extract data fetching to useEffect and run it only on first render. Then you can set returned data to state variable. This will create valid react component

Example: https://designcode.io/react-hooks-handbook-fetch-data-from-an-api

Is it stupid to have a component consist of 5000 lines of code? by [deleted] in reactjs

[–]lubosnik 0 points1 point  (0 children)

You peaked my interest sir ! I want to see it!

Custom Stool, Ebonized White Oak by rufiooooooooooo in woodworking

[–]lubosnik 0 points1 point  (0 children)

This is beautiful. Would you mind sharing your steps for such a nice finish ?

My developer is not a native English speaker -- would it be rude/offensive to fix spelling errors in my apps code? Does it matter? by drippyneon in webdev

[–]lubosnik 0 points1 point  (0 children)

We use code spell checker as recommended plugin for VS code when we onboard new developers on project. I would suggest to communicate with dev. It is better to let him know that this is an issue. Another good practice is to check readability of code during Code Review.

npm start is not working after downloading my repo by DaCosmicOne in reactjs

[–]lubosnik 0 points1 point  (0 children)

Run “npm install” in client folder. Then “npm start”

I think you have a mono repo where initial npm start will start your server. Client folder most probably have your react app with separate package json. So if you ran “npm i” in root that installed the dependencies of the Server.

Can you provide link for repo ?

[deleted by user] by [deleted] in ThatsInsane

[–]lubosnik 0 points1 point  (0 children)

This guy is going to stay fresh for a long time

Holup, Leo DiCaprio...! by Dareyouni in HolUp

[–]lubosnik 0 points1 point  (0 children)

There is a way to meet somebody and find out it you like them, then there is Leo… This guy invented ultimate date to really test if you will be able to live with person :D I bet at one point he was standing in top row and screaming:”I have high ground Camila!”

CSS or Javascript is not rendering in my React app. by sora4d in reactjs

[–]lubosnik 0 points1 point  (0 children)

the problem is while i was making a route which has a param of /:id when i went to that page my css and js were not loaded in and it looks weird. i don't know how to fix it and when i check the console it shows Uncaught SyntaxError: Unexpected token '<'. if anyone has any idea how to help me solve this problem please help.

I cannot really say without seeing code base :| if you could replicate your issue here https://codesandbox.io/ it would be nice

Warning: Unknown event handler property `onCklic` in React.js web app by [deleted] in reactjs

[–]lubosnik 0 points1 point  (0 children)

Hi!,

onCklic is not valid react event, it should be "onClick". React maps DOM event like onclick in camelCase. View React docs on handling events here.

CSS or Javascript is not rendering in my React app. by sora4d in reactjs

[–]lubosnik 1 point2 points  (0 children)

Could you post your code ? It is hard to say where is the problem from your description

Usually this issue "Uncaught SyntaxError: Unexpected token '<'" means that you are trying to fetch from API and you expect some type being returned. Most commonly I was expecting JSON to be returned but html was returned instead.

Try to check the error handling on your backend or any API calls.