Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
331 views
in Technique[技术] by (71.8m points)

javascript - SyntaxError: Expected corresponding JSX closing tag for <a>. Line (17:9)

As I am working on React.js since last week. The closing tags are already provided by me of anchor <a> tag in below snippet.


function App() {
  return (
    <div className="App">
            <table>
                <tr>
                    <td><img class='mainlogo' src='logoWAH.png' alt='logo' width='150px' height='auto'/></td>
                    <td align="right">
                    <table style='text-align:right;width:80%'>
                        <tr>
                            <td>
                                <a class='nav-item' href='#'>
                                    <span class='nav-img'>
                                    <img src='image/contact.png' alt='contact' width='20px' height='20px'/>
                                    </span>
                                    </br>
                                    <span class='contact'>Contact us 24/7</span>
                                </a>
                            </td>
                         </tr>
                     </table>
                  </td>
                </tr>
            </table>
         </div>  
     );
}

export default App;

As I am working on this, I haven't found this type of error. I already check all the opening and closing of tags. Please find the error and give me the best possible solution.

question from:https://stackoverflow.com/questions/65642102/syntaxerror-expected-corresponding-jsx-closing-tag-for-a-line-179

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The style attribute accepts a JavaScript object with camelCased properties rather than a CSS string.
Read https://reactjs.org/docs/dom-elements.html#style


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...