Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property 'stripe-pricing-table' does not exist on type 'JSX.IntrinsicElements'

I am following the Stripe documentation for embedding a pricing table at link, but run into this error: "Property 'stripe-pricing-table' does not exist on type 'JSX.IntrinsicElements'".

Here is my code:

import React from 'react';

export default function PricingTable() {
  return (
    <stripe-pricing-table
      pricing-table-id="prctbl_xxxxx"
      publishable-key="pk_test_xxxxx"
    ></stripe-pricing-table>
  );
}
I'd appreciate any help on this.
like image 411
DeonV Avatar asked Feb 03 '26 16:02

DeonV


1 Answers

I think that's more of a Typescript problem, you might have to declare a type for stripe-pricing-table along the lines of

import * as React from 'react'

declare global {
  namespace JSX {
    interface IntrinsicElements {
      'stripe-pricing-table': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
    }
  }
}
like image 60
karllekko Avatar answered Feb 05 '26 07:02

karllekko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!