[英]Prettier: Remove `return` of an arrow function, in JavaScript?
I would like to have prettier removes the unnecessary return
statement.我想让 prettier 删除不必要的return
语句。
For the next code example:对于下一个代码示例:
const Component = ({ children }) => {
return (
<div>
{children}
</div>
);
};
I would like prettier removes the return
statement, and turn it into:我想更漂亮地删除return
语句,并将其变成:
const Component = ({ children }) => <div>{children}</div>;
Is it possible?可能吗?
Olá Tente desta forma por favor. Olá Tente desta forma por 青睐。 Pois acredito que não sejam necessárias as chaves {} dentro dos parenteses () e nem o return. Pois acredito que não sejam necessárias as chaves {} dentro dos parenteses () e nem o return。
const Component = (children) => ( {children} ) const 组件 = (children) => ( {children} )
}; };
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.