小编Eip*_*Too的帖子

Elements 上不支持的道具更改:设置后无法更改 `stripe` 道具

Stripe Payment 完全正常,但我在控制台上收到警告消息,“元素上不支持的道具更改:stripe设置后无法更改道具。” 这是我的代码。我不知道为什么会显示警告消息,我错过了什么?

const Parent =() => {
        const stripePromise = loadStripe(PUBLISHABLE_KEY);
        <Elements stripe ={stripePromise}>
          <Child_component/>
        </Elements> 
}
export default Parent;

import {CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';
const Child_component =() => {
        const handleChange = (event) => {
               //get the brand type
        };
        const handleFormSubmit = async ev =>{
           const cardElement = elements.getElement(CardNumberElement);
           const paymentMethodReq = await stripe.createPaymentMethod({
                    type: 'card',
                    card: cardElement
           });
           /// and send paymentMethodReq to the backend.
        }
   render(
       <Form className="" onSubmit={handleFormSubmit}>
        <div …
Run Code Online (Sandbox Code Playgroud)

stripe-payments reactjs next.js

4
推荐指数
2
解决办法
1224
查看次数

标签 统计

next.js ×1

reactjs ×1

stripe-payments ×1