Skip to content
Advertisement

send id (or get id from router path)

I got simple blog (react/redux) (only frontend part). With user registration and articles. And stuck when tryed to send id to editor. I have same form, but different path for add new and for edit existing article:

JavaScript

it might be simple but I have no idea how to send(or get) id to ArticleEditor component to fill form. Plz help if you have good knowledge in React/Redux.

here is the code: https://codesandbox.io/s/twilight-resonance-d9tu6

Advertisement

Answer

you should use useParams

JavaScript
JavaScript

or in class component

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement