How to extract props of a react component using static code analyzer?

77 Views Asked by At

I'm creating a code analyzer for react. For example, if we have Cart.js:

const Cart = ({
    products,
    discount,
    shipment,
    payment
}) => {
    return <div>
        {
            products.map(product => <Product
                {...product}
                canModify
                modifier={<Modifier />}
                images={2}
                onClick={p => setAsSelectedProduct(p)}
            />)
        }
    </div>
}

I want to get the <Product component that is used here, but in my static code analyzer tool, let's say in Python.

How can I do that? Is there a library that can help us get token tree?

0

There are 0 best solutions below