How do you write JavaScript within HTML of TypeScript file?

I am developing a project with React Native which uses TypeScript. And coming from React.js, I noticed I am not able to put JavaScript within the HTML. Is there a way I can use the following code within .jsx HTML?

return (
      {
        searchData.map((stock, index) => (
          <h1 key={index}>{stock.symbol}</h1>
        )
      }
)

75 thoughts on “How do you write JavaScript within HTML of TypeScript file?”

Leave a Comment