Augustos
KPCKevin Powell - Community
•Created by Hashir Akbar on 12/17/2023 in #front-end
How to make this Line scroll in container with mouse
or mutations that we will keep track of
6 replies
KPCKevin Powell - Community
•Created by Hashir Akbar on 12/17/2023 in #front-end
How to make this Line scroll in container with mouse
since u starting, keep in mind, that most of the time, we will have browser events to listen, https://developer.mozilla.org/pt-BR/docs/Web/API/EventTarget/addEventListener
6 replies
KPCKevin Powell - Community
•Created by Hashir Akbar on 12/17/2023 in #front-end
How to make this Line scroll in container with mouse
so in this case, we just listen to the darg, and movement of dragged element
6 replies
KPCKevin Powell - Community
•Created by Hashir Akbar on 12/17/2023 in #front-end
How to make this Line scroll in container with mouse
we could start a mini project for this, but basically this is not a scroll, is a drag.
There an Native API, drag and drop: https://developer.mozilla.org/pt-BR/docs/Web/API/HTML_Drag_and_Drop_API
6 replies
KPCKevin Powell - Community
•Created by Augustos on 11/27/2023 in #front-end
How can i center a item in a flex row div, when has 2 childs?
? yes, i have, with margin auto on the section that i want in the center
6 replies
KPCKevin Powell - Community
•Created by Augustos on 11/27/2023 in #front-end
How can i center a item in a flex row div, when has 2 childs?
consider the code:
6 replies
KPCKevin Powell - Community
•Created by Augustos on 11/17/2023 in #front-end
Animation when things are loaded, tailwind with reactjs
3 replies
KPCKevin Powell - Community
•Created by emeric_owczarz on 9/8/2023 in #front-end
Dark mode / dark theme implementation in SASS
also, if u wanna a button that changes it, you gonna need JS as far as my knowledge goes
18 replies
KPCKevin Powell - Community
•Created by emeric_owczarz on 9/8/2023 in #front-end
Dark mode / dark theme implementation in SASS
@media (prefers-color-scheme: dark)
and it's all you need, for that 1% scenario, you may want js, but css is all you need these days.18 replies
KPCKevin Powell - Community
•Created by Augustos on 8/24/2023 in #front-end
Why should i not use `()=> {}` on components elements like `onChange` or `onClick` in React?
yeah, i do think it's not a good pattern, but at the same point, wouldn't argued against it on my job, what i'm searching is more about how this affect the way react works, and do things
11 replies
KPCKevin Powell - Community
•Created by Augustos on 8/24/2023 in #front-end
Why should i not use `()=> {}` on components elements like `onChange` or `onClick` in React?
yes
11 replies
KPCKevin Powell - Community
•Created by Augustos on 8/24/2023 in #front-end
Why should i not use `()=> {}` on components elements like `onChange` or `onClick` in React?
i was really concerned about it, but like my mind was saying: "nah, there is no problem here", but at the same time, i remember of this guys explaining it to me, and made a lot of sense.
So i searched today and 2 things:
First: This (the conversation i had) was in react Class Components time, and yep, inside of the
render()
in classes components, things like: <button onClick={() => console.debug('many code goes here')}</button>
is bad. see: https://itnext.io/dont-use-inline-functions-or-bind-in-react-ref-callbacks-5559e4342ead
Second: it's also a "problem" in function components, but not a problem like in classes.
In function components, it causes re-render in their children's, see:
https://stackoverflow.com/questions/68117926/inline-functions-in-react-cause-re-renders
and the codesanbox: https://codesandbox.io/s/determined-babbage-w495w?file=/src/App.js11 replies
KPCKevin Powell - Community
•Created by Augustos on 8/24/2023 in #front-end
Why should i not use `()=> {}` on components elements like `onChange` or `onClick` in React?
yes, was just example, but
11 replies
KPCKevin Powell - Community
•Created by Moni on 8/22/2023 in #front-end
Dot carousel in react js
as Joao said, it's easiest to use a lib. Personally i think https://swiperjs.com/ is one of the best libs for carousel that u can find, and i also think is easy to use effects with it, like the one u want
5 replies
KPCKevin Powell - Community
•Created by Moni on 8/22/2023 in #front-end
Dot carousel in react js
i don't know exactly how, but i do know that u're looking fora vertical carousel with parallax effect on scroll
5 replies
KPCKevin Powell - Community
•Created by Hamza Naeem on 8/19/2023 in #front-end
is it good approach or not?
It's not a bad practice, it's a god approach, very common, note that, give nthe right amount of css or html, the more u could repeat yourself, the better would be to have these patterns, so u could use it with anything like, padding, margin and etc... So it's fine, go on.
Another css libraries(?)/frameworks use this approach as well
3 replies
KPCKevin Powell - Community
•Created by Augustos on 8/16/2023 in #front-end
Best way to handle many possible components to render?
oh yeah, but i mean, inside another component, i'm searching better way than using many
and etc
6 replies
KPCKevin Powell - Community
•Created by Augustos on 6/29/2023 in #front-end
CSS Animation changing the background with many images
yeah, i'm trying to do it, but moving the background doesn't feel the same way
6 replies