Skip to content

TSX/JSX: components used as <Comp /> get no incoming edge #3854

Closed

Description

@sinangumuskabak-sys

I use graphify on a React Native (Expo) app and noticed that components rendered with JSX never get an incoming edge, so affected / query tell me most of my components aren't used anywhere.

Small repro:

// components/Bubble.tsx
export function Bubble({ text }: { text: string }) { return <span>{text}</span>; }
export default function Card() { return <div />; }

// app/Screen.tsx
import Card, { Bubble } from '../components/Bubble';
export function Screen() {
  return (
    <Card>
      <Bubble text="hi" />
    </Card>
  );
}
export function helper() { return Bubble({ text: 'x' }); }

On v8 (0.9.69) I get helper() -> Bubble() but nothing from Screen() to Bubble() or Card().

Looks like the JSX nodes (jsx_self_closing_element, jsx_opening_element) just aren't in call_types for the JS/TSX configs, and the tag sits in the name field rather than function. I have a fix locally and can open a PR if that approach sounds OK. Lowercase tags like <div> / <motion.div> would be skipped so they can't bind to some unrelated div() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions