javascriptfacebookreactjs

reactjs - anchor tag link


I'm trying to figure out how to output these lines of codes into something like

<a href="http://">SOMETHING</a>

enter image description here

BASE_URL as enter image description here

When I run this code, I get this output in the browser: enter image description here

What's the correct way of doing this?


Solution

  • In this case, you just need to lose the quotes:

    <a href={BASE_URL}>
    

    You can play with the JSX compiler at babeljs to get a slightly better idea of what JS it compiles into.