Skip to content

Instantly share code, notes, and snippets.

@zilahir
Created July 24, 2019 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zilahir/4121cae67e045caacf2b12634e18df24 to your computer and use it in GitHub Desktop.
Save zilahir/4121cae67e045caacf2b12634e18df24 to your computer and use it in GitHub Desktop.
eslint-error
/* 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 =
*/
@zilahir
Copy link
Author

zilahir commented Jul 24, 2019

the fun thing is, it's even get the error if i disable eslint at the top of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment