Last active
March 17, 2019 11:23
-
-
Save bussiere/1fbd9d6e38005ee2e88878dd29ee33f4 to your computer and use it in GitHub Desktop.
Onlick Eroor
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
import * as React from 'react'; | |
import { any } from 'prop-types'; | |
function handleClick(this:any,name:React.ReactNode) { | |
console.log('The link was clicked.'); | |
this.props.callbackFromParentSearch(name); | |
} | |
export const Suggestions = (props:any) => { | |
const options = props.results.map((r: { id: React.Key; name: React.ReactNode; }) => ( | |
<a href="#" onClick={handleClick(r.name)}> | |
<li key={r.id}> | |
{r.name} | |
</li> | |
</a> | |
)) | |
return <ul>{options}</ul> | |
} | |
export default Suggestions; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment