Skip to content

Commit 5a3664a

Browse files
fix eslint errors
1 parent 180f848 commit 5a3664a

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/index.test.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable react/prop-types */
12
import React from 'react';
23
import {render, unmountComponentAtNode} from 'react-dom';
34
import useDynTabs from './index.js';
@@ -177,7 +178,7 @@ describe('apply multiple actions : ', () => {
177178
});
178179
});
179180
describe('lazy tabs : ', () => {
180-
const LazyPanel = () => {
181+
const LazyPanel = function LazyPanel() {
181182
const Panel = React.lazy(() => import('./mock/mock-lazy-panel-1.js'));
182183
return (
183184
<React.Suspense fallback={<p>loading...</p>}>
@@ -192,18 +193,24 @@ describe('lazy tabs : ', () => {
192193
id: '1',
193194
title: 'mock tab 1',
194195
lazy: true,
195-
panelComponent: <p>tab1 content</p>,
196+
panelComponent: function Panel() {
197+
return <p>tab1 content</p>;
198+
},
196199
},
197200
{
198201
id: '2',
199202
title: 'mock tab 2',
200-
panelComponent: <p>tab2 content</p>,
203+
panelComponent: function Panel() {
204+
return <p>tab2 content</p>;
205+
},
201206
},
202207
{
203208
id: '3',
204209
title: 'mock tab 3',
205210
lazy: true,
206-
panelComponent: () => <p>tab3 content</p>,
211+
panelComponent: function Panel() {
212+
return <p>tab3 content</p>;
213+
},
207214
},
208215
{
209216
id: '4',

src/mock/mock-lazy-panel-1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import React from 'react';
2-
export default (props) => {
2+
export default function LazyPanel() {
33
return <p> mock lazy panel 1</p>;
4-
};
4+
}

src/panel/panel.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ describe('panel structure : ', () => {
137137
instance.activedTabsHistory.tabsId = ['3', '4'];
138138
instance.getTab = (id) => ({
139139
lazy: true,
140-
panelComponent: () => {
140+
panelComponent: function Panel() {
141141
let LazyPanel;
142142
if (id === '4') {
143-
LazyPanel = (props) => {
143+
LazyPanel = function LazyPanel() {
144144
const Panel = React.lazy(() => import('../mock/mock-lazy-panel-1.js'));
145145
return (
146146
<React.Suspense fallback={<p>loading...</p>}>

0 commit comments

Comments
 (0)