click-to-component icon indicating copy to clipboard operation
click-to-component copied to clipboard

Make getPathToSource configurable as a prop

Open dariocravero opened this issue 2 years ago • 4 comments

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. :)

dariocravero avatar Apr 27 '22 16:04 dariocravero

⚠️ 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

changeset-bot[bot] avatar Apr 27 '22 16:04 changeset-bot[bot]

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.

dariocravero avatar Apr 28 '22 09:04 dariocravero

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

frantic avatar Apr 28 '22 15:04 frantic

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: @.***>

dariocravero avatar Apr 29 '22 09:04 dariocravero