Last active
August 23, 2023 12:41
-
-
Save EmmanuelObua/88018303e7b21b30c539fe9419787af1 to your computer and use it in GitHub Desktop.
This file contains 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 React, { useState, Fragment } from 'react'; | |
import { Container, Row, Col } from 'react-bootstrap'; | |
import { TaskProvider } from './components/TaskContext'; | |
import { withTaskContext } from './components/withTaskContext'; | |
import TaskList from './components/TaskList'; | |
import TaskForm from './components/TaskForm'; | |
function App() { | |
//The TaskList component is passed through a withTaskContext HOC that returns a component | |
// that can be rendered on a page | |
const TaskListWithHOC = withTaskContext(TaskList); | |
return ( | |
<Container className="app-container"> | |
<Fragment> | |
<div className="App"> | |
<TaskProvider> | |
<Container> | |
<Row> | |
<Col> | |
<h5 className="text-center p-4">Task Management App</h5> | |
</Col> | |
</Row> | |
<Row> | |
<Col md={6}> | |
<TaskForm /> | |
</Col> | |
<Col md={6}> | |
<h6>Task List</h6> | |
<TaskList /> | |
<h6>Task List With HOC</h6> | |
<TaskListWithHOC/> | |
</Col> | |
</Row> | |
</Container> | |
</TaskProvider> | |
</div> | |
</Fragment> | |
</Container> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment