ericclemmons / click-to-component

Option+Click React components in your browser to instantly open the source in VS Code
MIT License
1.82k stars 65 forks source link

Make getPathToSource configurable as a prop #26

Open dariocravero opened 2 years ago

dariocravero commented 2 years ago

We have a use case in which some of our React components are actually morphed from another file type. By exposing that prop we can replace the file name and open the real source instead.

Thanks for making this component! It's super handy. :)

changeset-bot[bot] commented 2 years ago

⚠️ No Changeset found

Latest commit: 5c5234efcabe3ef39cb1ccfe3462660080571283

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

dariocravero commented 2 years ago

I'll be alright with having an onOpenComponent/onOpenFile prop too like in #29 btw. I agree that it could then be used for other integrations other than text editors as @frantic said.

frantic commented 2 years ago

Let's roll with onOpenComponent? The downside that the user of this code would have to format the file path and call window.open themselves but I think it's okay, just a more advanced option. I'll update the PR

dariocravero commented 2 years ago

Yeah, I think it's grand :)

On Thu, Apr 28, 2022 at 5:19 PM Alexander Kotliarskyi < @.***> wrote:

Let's roll with onOpenComponent? The downside that the user of this code would have to format the file path and call window.open themselves but I think it's okay, just a more advanced option. I'll update the PR

— Reply to this email directly, view it on GitHub https://github.com/ericclemmons/click-to-component/pull/26#issuecomment-1112338800, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC33TCT5U5VTZSVXBIGP3DVHKUBPANCNFSM5UPU4AEQ . You are receiving this because you authored the thread.Message ID: @.***>