Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

(0 , _reactRouterDom.useHistory) is not a function

You are using the beta version of react-router-dom. In v6, useHistory is 
replaced by useNavigate

https://dev.to/zenveus/routing-with-react-router-v6-6b1

If you want to use useHistory you should install v5 instead.

const navigate = useNavigate();

const onSavePostClicked = () => {
  if (name && description) {
    dispatch(todoUpdated({ id: todoId, name, description }));
    navigate(`/todo/${todoId}`);
  }
};
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery toggle show hide 
Javascript :: content editable vuejs 
Javascript :: run cypress 
Javascript :: livewire upload progress 
Javascript :: discord.js send embed 
Javascript :: react native new line character 
Javascript :: react native submit on enter key 
Javascript :: speedtest-net node.js 
Javascript :: vue js select option disabled false 
Javascript :: neo4j create relationship between existing nodes 
Javascript :: javascript string change character at index 
Javascript :: react counter input 
Javascript :: node js query get :id param 
Javascript :: capitalize the string 
Javascript :: electron main.js template 
Javascript :: dynamically add script code to page 
Javascript :: find duplicates in array javascript 
Javascript :: async queue.push 
Javascript :: for of array javascript 
Javascript :: moment date without timezone 
Javascript :: express get host url 
Javascript :: set focus on load javascript 
Javascript :: prop-types 
Javascript :: relaod the page in express 
Javascript :: gcloud storage cors 
Javascript :: how to get the url of a page in javascript 
Javascript :: To append dropdown option using jquery 
Javascript :: add char in specific index stirng javascript 
Javascript :: vue get element height 
Javascript :: toggle button by javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =