eslint - remove react/jsx-no-useless-fragment ignoring & fix

pull/8749/head
LB Johnston 2022-06-23 22:24:56 +10:00 zatwierdzone przez LB (Ben Johnston)
rodzic f6107166ed
commit 0dfa39d3c5
3 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -94,7 +94,6 @@ module.exports = {
'react/destructuring-assignment': 'off',
'react/forbid-prop-types': 'off',
'react/function-component-definition': 'off',
'react/jsx-no-useless-fragment': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-danger': 'off',
'react/no-deprecated': 'off',

Wyświetl plik

@ -82,12 +82,12 @@ export interface CommentProps {
}
export default class CommentComponent extends React.Component<CommentProps> {
renderReplies({ hideNewReply = false } = {}): React.ReactFragment {
renderReplies({ hideNewReply = false } = {}): React.ReactFragment | null {
const { comment, isFocused, store, user } = this.props;
if (!comment.remoteId) {
// Hide replies UI if the comment itself isn't saved yet
return <></>;
return null;
}
const onChangeNewReply = (value: string) => {
@ -154,7 +154,7 @@ export default class CommentComponent extends React.Component<CommentProps> {
// Hide new reply if a reply is being edited as well
const newReplyHidden = hideNewReply || replyBeingEdited;
let replyForm = <></>;
let replyForm;
if (!newReplyHidden && (isFocused || comment.newReply)) {
replyForm = (
<form onSubmit={sendReply}>
@ -186,7 +186,7 @@ export default class CommentComponent extends React.Component<CommentProps> {
// If there is no form, or replies, don't add any elements to the dom
// This is in case there is a warning after the comment, some special styling
// is added if that element is that last child so we can't have any hidden elements here.
return <></>;
return null;
}
return (

Wyświetl plik

@ -540,7 +540,7 @@ function getCommentDecorator(commentApp: CommentApp) {
}, [commentId, annotationNode, blockKey]);
if (!enabled) {
return <>{children}</>;
return children;
}
const onClick = () => {