kelsonpw / react-chrome-extension-router

A dead simple routing solution for browser extensions written in typescript with React Hooks. Context free.
MIT License
51 stars 7 forks source link

To get current location #3

Closed isabirahmed closed 3 years ago

isabirahmed commented 4 years ago

Firstly thank you for creating this package. I was wondering if there is any way to get the name/path of the current component. Similar to props.location supported by react-router. I know we don't have a path component in your library, but was still wondering if there is any other way to achieve this. Thanks.

kelsonpw commented 4 years ago

Hey @sabirahmed121 thanks for the issue, I am working on a solution for this problem right now, i will let you know when its ready to go.

Thanks so much for using my package!

kelsonpw commented 4 years ago

Hey @sabirahmed121, I just published v1.0.2. This includes a new getCurrent function that returns an object: {component: CurrentComponent, props: CurrentComponentProps}

kelsonpw commented 4 years ago

I also updated the readme to show how to use this. Let me know if this doesnt solve your use case

isabirahmed commented 4 years ago

Thanks for the feature! Will check it out!