DEV Community

Discussion on: Add color to your code block

Collapse
 
_moehab profile image
Mahmoud Ehab

alt

Collapse
 
suyashdev profile image
Suyash Vashishtha

Okk so I found out it only takes native language code...anything for frameworks like React js ?

Thread Thread
 
_moehab profile image
Mahmoud Ehab

It should work in ReactJS code (JSX Components) as well. It does in npmjs.com.
If there's no way to make it works in JSX tags as well here, so I guess dev community developers should use another libarary for rendering md files.

Thread Thread
 
suyashdev profile image
Suyash Vashishtha • Edited

Finally I found a way ..

 const [state, setState]= useState(0);
Enter fullscreen mode Exit fullscreen mode

This coloring can be achieved like this... It doesn't work without div tho.

code