I have
const stripeResponse = await stripe.confirmCardSetup(client_secret, {
payment_method: {
card: elements.getElement('cardNumber'),
billing_details: {
address: {
city: selectedAddress.town,
country: selectedAddress.country.iso3166Code,
line1: selectedAddress.line1,
line2: selectedAddress.line2,
postal_code: selectedAddress.postalCode,
state: selectedAddress.region,
},
email: 'ppp@mail.com',
name,
phone: selectedAddress.phone,
},
},
});
With this I confirm card setup and I am using react-stripe-js inside react component:
import { CardNumberElement } from '@stripe/react-stripe-js';
//some component code below
...
<CardNumberElement options={options} />
...
It is not possible to get card number from CardNumberElement component.
How can I get card number with stripe?
the closest thing I could find was as below, but I need client js preferably react version of it

You cannot get the card number from Stripe. That is a big part of why you need to use Stripe's libraries, so that card details don't touch your integration.
Full raw card number is never exposed in API responses from Stripe: https://stripe.com/docs/security/guide