click-to-react-component-intellij
Version:
Option+Click your React components in your browser to open the source file in intellij
19 lines (15 loc) • 338 B
JavaScript
/**
* @typedef {import('react-reconciler').Fiber} Fiber
* @typedef {import('react-reconciler').Source} Source
*/
/**
* @param {Fiber} instance
*/
export function getSourceForInstance({ _debugSource }) {
if (!_debugSource) return
const {
fileName,
lineNumber = 1,
} = _debugSource
return { fileName, lineNumber }
}