How can I use comments inside the render method in a React component?
I have the following component:
\'use strict\';
1) // (Double Forward Slash) is used to comment only single line in react native code but it can only be used outside of the render block. If you want to comment in render block where we use JSX you need to use the 2nd method.
2) If you want to comment something in JSX you need to use JavaScript comments inside of Curly braces like {/comment here/}. It is a regular /* Block Comments */, but need to be wrapped in curly braces.
shortcut keys for /* Block Comments */:
Ctrl + / on Windows + Linux.
Cmd + / on macOS.