It-s-Saturday / Fornear

Nurturing Oglethorpe University students with reliable access to food
1 stars 8 forks source link

bug: eliminate all console errors #32

Closed itsjayway closed 1 year ago

itsjayway commented 1 year ago

errors caused by undefined props and no key stated in .map

neeravbhaskarla commented 1 year ago

get I get this issue assigned?

itsjayway commented 1 year ago

of course, thank you @neeravbhaskarla

itsjayway commented 1 year ago

i've updated the readme with updated steps for running the db locally, i hope it helps!

https://github.com/It-s-Saturday/Fornear/blob/a589563a5926665f4493e9d923aebad2809b4abe/README.md?plain=1#L65-L69

neeravbhaskarla commented 1 year ago

Hi @jibranabsarulislam, undefined props error is occurring due to rendering element without passing props in the App.jsx

Screenshot 2023-06-29 at 7 02 57 PM

Hence, for removing undefined props error there are two approaches which are

  1. Adding default props by removing .isRequired in most of the components

    Screenshot 2023-06-29 at 6 24 54 PM
  2. Sending default props with the component

    Screenshot 2023-06-29 at 7 08 47 PM

  Can you suggest a better approach from these two to implement changes in the code?

itsjayway commented 1 year ago

Can you suggest a better approach from these two to implement changes in the code?

I think your first approach is good; removing isRequired and setting default props (probably false and null) makes sense, so we don't clutter component instances with refresh={false} (which would also be an es-lint error)

neeravbhaskarla commented 1 year ago

hi @jibranabsarulislam Submitted PR with required changes. Please Check