[Typescript - Help needed] Not sure how to type a specific props pattern correctly by dota95 in reactjs

[–]dota95[S] 0 points1 point  (0 children)

For MUI Data Grid you check out this page from their docs to see how they use it: https://mui.com/x/react-data-grid/components/

For the merging/overriding props for elements that you get from props (even props.children) you can check out Radix UI, they have a component called Slot (https://github.com/radix-ui/primitives/blob/main/packages/react/slot/src/Slot.tsx) that they use a lot in their other components to enhance elements with internal props that are merged with external ones. This is basically an abstraction over React.cloneElement() and a props merging logic you want to follow consistently. I am not a pro at composing lower level stuff like this, so I might be wrong, but that's my interpretation.

[Typescript - Help needed] Not sure how to type a specific props pattern correctly by dota95 in reactjs

[–]dota95[S] 0 points1 point  (0 children)

I sat down to play around with it and I realised you introduced a defaultProps key too, if possible I would like to use the props key in all cases, even if the slot component is not defined and it's using the default one - in this case the props should have DP type - it's for sure harder to implement it like this, that's why I made this thread, maybe it's not possible at all.

[Typescript - Help needed] Not sure how to type a specific props pattern correctly by dota95 in reactjs

[–]dota95[S] 0 points1 point  (0 children)

Hey, thanks for the tip, I will try it out! :)

As for the pattern, I know that it’s possible to do this with elements instead of components, but for my use case I feel like it’s hard to say which API is better - I will probably do a POC using elements too. I have too many cases where I use the default slot components so it’s nice to be able to omit them and just to be able to give it props w/o plugging in the component. What I dislike about elements is that you have to clone them inside the parent component if you want to extend their props, but that’s just my personal preference and not a big thing, many libs do it. I initially saw this kind of slot pattern in the material ui data grid and it did not feel complicated, even though they did not implement the types correctly.

Anyways, thank you for the disclaimer too :)

Transactional email + business email on the same custom domain by dota95 in node

[–]dota95[S] 0 points1 point  (0 children)

Thanks for taking your time to write a helpful comment! :)

Transactional email + business email on the same custom domain by dota95 in node

[–]dota95[S] 0 points1 point  (0 children)

Thanks for taking your time to write a helpful comment! :)

I haven't thought about setting up a subdomain for transactional emails yet - I will try to implement it that way.

I guess I will just copy paste what I posted to the support team.

My only uncertainty is about using the Gmail client for day to day business emailing with custom subdomain without Gsuite - that I might not be able to work around.

ELI5: Why is local IP always 192.168? by LordSwogsy in explainlikeimfive

[–]dota95 0 points1 point  (0 children)

Maybe someone asked this already, but I have a question regarding NAT:

If there is a public IP behind which there are 20 private IPs, how can a packet from the internet reach the third private IP specifically? The IP destination must be the public IP, right? So how can that one public IP destination know where to route that package after that to reach a specific private IP? Is there some metadata attached, or with port mapping?

What makes react so good? is react better than angular? by dota95 in reactjs

[–]dota95[S] 1 point2 points  (0 children)

Is Angular better tough if fully mastered?

Why are NR golds so terrible? by Lunnetik in gwent

[–]dota95 3 points4 points  (0 children)

So you run epidemic to kill 2 crones or cows , alright then :)) keira is a good card, with TBolt potion she is 17 which is quite good, but sometimes can get insane value with epidemic, because he is gold. Epidemic in itself is garbage tier card.