[英]Getting Expected an assignment or function call and instead saw an expression no-unused-expressions error when trying to render a component in React
[英]Expected an assignment or function call and instead saw an expression no-unused-expressions when trying to make a component using react
我收到此錯誤,我無法解決此問題:- 第 6 行:預期分配或 function 調用,而是看到一個表達式 no-unused-expressions
import React from 'react';
import classes from './BurgerGraphic.module.css';
import BurgerIng from './BurgerIng/BurgerIng';
const BurgerGraphic = (props) => {
return
(
<div className={classes.Burger}>
<BurgerIng type="bread-top" />
</div>
);
};
export default BurgerGraphic;
JavaScript 要求返回值與返回值本身在同一行。
這可以通過在與返回相同的行上打開括號然后在多行中輸入返回值來解決。
import React from 'react';
import classes from './BurgerGraphic.module.css';
import BurgerIng from './BurgerIng/BurgerIng';
const BurgerGraphic = (props) => {
return (
<div className={classes.Burger}>
<BurgerIng type="bread-top" />
</div>
);
};
export default BurgerGraphic;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.