Created
July 24, 2019 09:57
-
-
Save zilahir/4121cae67e045caacf2b12634e18df24 to your computer and use it in GitHub Desktop.
eslint-error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable */ | |
import React from 'react' | |
import PropTypes from 'prop-types' | |
import LibraryHeaderStyle from './LibraryHeader.module.scss' | |
const LibraryHeader = (props) => { | |
const { selectedTab } = props | |
const tabs = [ | |
{ index: 1, label: 'tab1' }, | |
{ index: 2, label: 'tab2' }, | |
] | |
function selecTab(index) { | |
selectedTab(index) | |
} | |
return ( | |
<div className={LibraryHeaderStyle.container}> | |
<ul> | |
{ | |
tabs.map(tab => ( | |
<li key={tab.index}> | |
<button type="button" onClick={() => selecTab(tab.index)} onKeyDown={null}> | |
{tab.label} | |
</button> | |
</li> | |
)) | |
} | |
</ul> | |
</div> | |
) | |
} | |
LibraryHeader.propTypes = { | |
selectedTab: PropTypes.func.isRequired, | |
} | |
export default LibraryHeader | |
/* erorr is: | |
20:17 error Parsing error: Unexpected token = | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the fun thing is, it's even get the error if i disable eslint at the top of the file.