0

For context: right now I'm adding a temporary conditional statement around a subtitle inside a return statement for a react component. It's just a quick fix for until I add back in a new list of subtitles

What's the purpose of that extra () after the unnamed function? This block of code doesn't work without it and I forgot why

Sorry if this is a simple question but I just read through the javascript docs and didn't see anything talking about this

return(
   <div>
        other stuff  blah blah blah

        {(() => {
             if (subtitleId !== 'two') {
                  return (
                       <P key={subtitleId} />
                  );
             }
        })( this right here )}
   </div>
)

0 Answers0