0

I have component that giving link to component's declare file location.

<DevWrap
vsCodeLink={
        {
            path: "src/PathOfComponent/MyComponent.tsx",
            column: 10,
            line: 184
        }
    } >
</DevWrap>

When click this, it quikly open vscode(IDE) with given path.

This component helps to find location of component when i have a complex component tree.

But it bothers me that I have to write path myself.

I thought the runtime environment would not be able to tell where the component declaration is.

However, after getting to know this object, I changed my mind a bit.

React['__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED'].
This object seems to have information about the development environment.

Can i find the file path?

I have a development environment of Creact-React-App.

MINJA KIM
  • 876
  • 1
  • 8
  • 22

0 Answers0