Closed jakefroeb closed 3 years ago
Ticket MUST be completed before getting help from an instructor
c46 Help-Thread
Blocker
calling useHistory() is breaking my code
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
I have tried running the npm i --save react-router-dom REQUIRED: Copy/paste link TO THE FILE on your branch that you are having issues with https://github.com/nss-day-cohort-46/reactive-nutshell-garment-of-illusions-1/tree/jhf-tasks-postTask/src/components/tasks
I have tried running the
npm i --save react-router-dom
https://github.com/nss-day-cohort-46/reactive-nutshell-garment-of-illusions-1/tree/jhf-tasks-postTask/src/components/tasks
import { useHistory } from "react-router-dom" import React from "react" export const TaskList = () => { const history = useHistory() return ( <> <button onClick={()=> history.push("/tasks/create")}>Add Task</button> </> ) }
@sageklein @jisie test example
@ajawashington comments test for c46-help-repo
@jakefroeb ignore this @mention.
Was not calling function correctly in JSX.
Ticket MUST be completed before getting help from an instructor
Name: Jake Froeb
Breakout Room: garment of illusions
Have you searched the other issue tickets? If not, do that first.
REQUIRED Add Tags to Issue Ticket and Assign to Project Board
c46 Help-Thread
project boardBlocker
label if this is stoping you from moving forwardREQUIRED Describe your issue:
REQUIRED Copy/paste any error messages that appear:
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
REQUIRED: What have you tried? Tell us everything you have tried.
Code Snippet