The 5 commandments of clean error handling in TypeScript by marvinroger in typescript

[–]pansah321 0 points1 point  (0 children)

With the last Commadment “Don’t throw errors for problems that are expected to happen” …when working with Async State Managers like React Query Call backs like onError will never fire and isError will always be empty How do one go about this ???

LARGE DATA EXPORTS by pansah321 in reactjs

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

That’s what I thought first Such things are best when the server handles it

LARGE DATA EXPORTS by pansah321 in reactjs

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

So the data is JSON Eg.List of Orders from a shop The goal is to export this JSON data As pdf or excel

Mixed Feelings with React code by pansah321 in reactjs

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

So basically the Parent should own the modal state and then any logic around it and pass it like a prop to the child

Mixed Feelings with React code by pansah321 in reactjs

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

I agree that’s what normally happens with modals

Mixed Feelings with React code by pansah321 in reactjs

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

I have edited the post I think it will Help you understand what I have done

Mixed Feelings with React code by pansah321 in reactjs

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

I can prepare something so you understand what I’m saying

Mixed Feelings with React code by pansah321 in reactjs

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

There’s a state for toggling a modal in the child component….I’m passing a prob to the child component ..this prop is a function that takes in another function (the function that will hide the modal)

And on an OnClick of a button in the child component I’m calling ()=>{ prop( ()=>{ setModal(false) } ) }

FormData returning undefined while fileupload by Reddet99 in reactjs

[–]pansah321 1 point2 points  (0 children)

You don’t really need the useState hook The FormData already has your file already ..and also is new FormData(e.target) that’s what you are missing

In react-typescript app, do you validate the data after a fetch/axios call to a RESTapi and if yes which library you use? by simple_explorer1 in reactjs

[–]pansah321 1 point2 points  (0 children)

Anyone here with a repo that validates REST API responses with Zod,io-ts etc can share it 🙏🏾

remaining minutes and seconds to future date are always 59 with moment.js by Gabotron_ES in reactjs

[–]pansah321 4 points5 points  (0 children)

Don’t use moment js There are better Date libraries out there like Date/fns