(add-hook 'js-mode-hook
(lambda ()
(setq-local comment-start "{/* ")
(setq-local comment-end " */}")))
It now works for JSX, but breaks on regular JS code (inside the same .jsx file):
const [open, setOpen] = React.useState(false);
const [options, setOptions] = React.useState([]);
becomes:
{/* const [open, setOpen] = React.useState(false); */}
{/* const [options, setOptions] = React.useState([]); */}
Would there be a way for the comment function to know whether it is in a JSX block or not, and act accordingly?