stripe-archive / react-stripe-elements

Moved to stripe/react-stripe-js.
https://github.com/stripe/react-stripe-js
MIT License
3.03k stars 319 forks source link

CardNumberElement Placeholder Not Working #532

Closed moderatelyfunctional closed 4 years ago

moderatelyfunctional commented 4 years ago

Hello, I have the following simple example.

import React from 'react';
import { CardNumberElement, CardExpiryElement, CardCvcElement } from '@stripe/react-stripe-js';

function CardSection(props) {
    return (
        <div>
            <CardNumberElement id="card-number" placeholder="Card Number" />
            <div className="space-2"></div>
            <CardExpiryElement id="card-expiry" placeholder="Exp Date (MM/YY)" className="StripeExpiry"/>
            <div className="space-2"></div>
            <CardCvcElement id="card-cvc" className="StripeCvc" />
        </div>
    );
};

However, the placeholders for CardNumberElement defaults to 1234... and ExpiryElement defaults to MM/YY. Why is the placeholder attribute not working?

moderatelyfunctional commented 4 years ago

Resolved on react-stripe-js library.