React 17 Design Patterns and Best Practices by Carlos Santana Roldán

React 17 Design Patterns and Best Practices by Carlos Santana Roldán

Author:Carlos Santana Roldán [Carlos Santana Roldán]
Language: eng
Format: epub, mobi
Tags: COM051260 - COMPUTERS / Programming Languages / JavaScript, COM060010 - COMPUTERS / Web / Browsers, COM060160 - COMPUTERS / Web / Web Programming
Publisher: Packt Publishing
Published: 2021-05-17T06:57:46+00:00


// Contexts

import { IssueContext, Issue } from '../contexts/Issue'

const Issues: FC = () => {

// Here you consume your Context, and you can grab the issues value.

const { issues, url } = useContext(IssueContext)

return (

<>

<h1>ContentPI Issues from Context</h1>

{issues.map((issue: Issue) => (

<p key={`issue-${issue.number}`}>

<strong>#{issue.number}</strong> {' '}

<a href={`${url}/${issue.number}`}>{issue.title}</a> {' '}

{issue.state}

</p>

))}

</>

)

}

export default Issues

If you did everything correctly, you should be able to see the issues list:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.