How to get URL parameteres in constructor() function? #16695
Unanswered
schwarzsky
asked this question in
Help
Replies: 1 comment
-
You can get the class Chat extends React.Component {
constructor(props) {
super(props);
console.log(props.router); but
With that said, you may want to search for some examples with socket io and React Hooks such as this one. Then you'd be able to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How to get id from chat/id url in constructor() function? I need to use in constructor() because i am listening socket events on constructor(), if i use any other function i can't listen socket events or i can't setstate for realtime update.
If you have any suggestions about code, system or anything i can think some new things.
Beta Was this translation helpful? Give feedback.
All reactions