DEV Community

Cover image for crud in mern stack

crud in mern stack

Muhammed Shamal PV on July 06, 2024

Follow me on LinkedIn Follow me on Github.com Click & Read skipping boaring section 😁 recommend for beginners; 1. Setting Up the ...
Collapse
 
ihssmaheel profile image
Mohamed Ismail • Edited
  1. create-react-app is deprecated, please use vite instead.
  2. Adding a language extension (eg., js) after the opening triple backticks in your code block helps enable syntax highlighting. ``` js

Great post for beginners, thank you for sharing!
PS: marking as high quality

Collapse
 
muhammedshamal profile image
Muhammed Shamal PV

Ya, I'll next time bro

Collapse
 
muhammedshamal profile image
Muhammed Shamal PV

I'll try to do more better next time

Collapse
 
labeedadar profile image
Labeed Ahmad

Image description any solutions?

Collapse
 
somapti_nahar_2732eafaed6 profile image
Somapti Nahar

use optional channing or null check
{todos?.map(todo => (
key={todo._id}
todo={todo}
updateTodo={updateTodo}
deleteTodo={deleteTodo}
/>
))}

Collapse
 
muhammedshamal profile image
Muhammed Shamal PV

I think you where wrongly type your code!

here the correct :

{todos?.map(todo => (
key={todo._id}
todo={todo}
updateTodo={updateTodo}
deleteTodo={deleteTodo}
/>
))}

Collapse
 
muhammedshamal profile image
Muhammed Shamal PV

use && before using this map.
(for only make mapping if it availble)

eg: let x = [1,2,3,4];

{x && x.map((val,index)=><div>{val}</div>)}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mateusguedess profile image
Mateus Guedes da Conceição

you can use optional chaining, right?

{x?.map((val,index)=><div>{val}</div>)}

Thread Thread
 
muhammedshamal profile image
Muhammed Shamal PV

again a good option bro

Thread Thread
 
hkara107144 profile image
huseyinkara

Hi,which resource do you recommend to learn mern stack ?

Thread Thread
 
muhammedshamal profile image
Muhammed Shamal PV • Edited

Always recommend using each documentations,

Identify, learn & understands other's codes from git for more.

And bro, always go with yourself taught that will create magic

Collapse
 
benjamin_peikes profile image
Benjamin Peikes

I thought create-react-app was no longer used?

Collapse
 
joel_nada profile image
Joel Nada

It's there but ur choice to use bro, I think you know vite, vite is best to use.

Collapse
 
mohammed_quintel_08e46bc3 profile image
mohammed quintel

it simple, thanks

Collapse
 
muhammedshamal profile image
Muhammed Shamal PV

your welcome bro

Collapse
 
reversetrip profile image
hm hmm

Wow, it's really concise:)

Collapse
 
frank_alimimian_1a2043cb5 profile image
Frank Alimimian

nice explanation

Collapse
 
vsh_torch profile image
Vengatesh TR

Great job. Thanks

Collapse
 
cmanjima profile image
Manjima C

Nice to Learn

Collapse
 
timilehin_abegunde_ec7afd profile image
Timilehin Abegunde

Really helpful for me as a beginner in Backend development

Collapse
 
muhammedshamal profile image
Muhammed Shamal PV

Ya bro