score:1
Accepted answer
your addscreen
function just returns link
which is a component, and this approach does not call any redirecting action (as you can see here, link results in an <a>
element).
you could use the usehistory
hook to access the history
object and push the adddata
route:
import { usehistory } from "react-router-dom";
let history = usehistory();
const addscreen = () => {
history.push("/adddata");
}
Source: stackoverflow.com
Related Query
- Page Navigation not working on Button Click
- React: Button onClick function is running on page load but not you click it
- page is not rendering when I click back button with react-router
- Back button not working in react native navigation
- React Routers not working on button click
- Next js : On back button click page content is not loading
- React Event Handler Button Click Not Working on First Click
- File Uplaod not working on Button click material-UI V1 ReactJs
- Why my dispatch is not working for button click event?
- Web frontend button click html tag not working
- React-Redux: Action Dispatch on button click not working
- Reactjs: Dialog open is not working on button click
- Nextjs only go to page on button click not by typing it directly into the browser
- My React 18 app does not reload automatically I try to click on the create new project button does not work unless I refresh the page manually
- Button Click inside anchor tag not working in React Js Component
- Material table next page not working when i click it
- Button click not working in ReactJs
- why my react js button click event not working
- history.push not working in wait or sync until button click
- add style to navigation menu only to a active page is not working as expected in react router v6
- Ternary operation not working on button click in reactJS?
- Chrome Extension: JS DOM button click method is not working
- React hook Search on button click not working
- React JS on page load data not getting loaded, however on click its working
- I want to pass a array of url to button using map () function. but on button click i get object but it does not navigate me to exact page
- React Routes are not working properly the URl changes but its rendering the one same page on any link i click ,
- React Button Click Event Not working correctly
- How can I trigger opening a select form's options on click of another button in react? I have tried using a ref but its not working
- The problem with redux not working on button click
- Click event not working after page scroll in safari with reactjs
More Query from same tag
- Getting the error as "TypeError: Cannot read property 'file' of undefined" when uploading a video using Multer
- GQL doesnt automatically invoke query
- Axios baseURL is not appending with the URL in react.js
- How to change two different .css class values with select option?
- Webpack for React doesn`t work
- Typescript CRA with MSW: failed to parse source map
- How to redirect to not found page if slug doesn't exist using React Router Dom?
- Destruct object properties in array.map() and keep object as parameter
- How to force a new sorting of mapped array?
- React Native: App Store Rejection, Support for IPv6
- Change the Date and Time in Date Picker based on Time zone
- Correct way of connecting Websocket events to update my React Component
- "i18next backendConnector: loading namespace failed" when using react-i18next useTranslationHooks
- React Display Data in React Table
- Redux Reducer won't set boolean object property
- get body from axios POST Request with Slim Framework
- How can I on Submit my Form redirect the Results to another Page in React
- How to fade the edge of a View in react native?
- How can I create an effective private route using the latest version of react-router-dom
- 'Product' s defined but never used in react?
- Why doesn't useEffect hook work on page refresh?
- React JS | Render Multiple Elements
- Changing setTimeout not working in React with Redux
- How can I call a component's method from another component in React?
- Storing layout for my react app in local storage not working
- React TypeScript: Correct type for useLocation() from react-router-dom
- Trouble updating UI with React useState when updating an array of items
- How to send data to socket.io from react?
- How to map Multiple dispatch actions to single prop in React Redux
- Emailjs just working sometimes with Microsoft Edge