Wrapping Kendo Cards

0 Answers 107 Views
Card
Jason
Top achievements
Rank 1
Jason asked on 07 Jul 2023, 08:51 PM

I'm working on a component library, and I'd like to wrap the Kendo Cards component with additional stuff that matches our requirements; however, I get an error about hooks being an issue due to the nesting.  Is there a way around this?


import { ReactNode } from 'react';
import { Card as KendoCard } from '@progress/kendo-react-layout';

export interface CardProps {
  /**
   * any nested JSX elements
   */
  children?: ReactNode;
}

/**
 * Primary UI component for wrapping content in a card
 */
const Card = ({ children }: CardProps) => (
  <KendoCard
    style={{
      width: 260,
      boxShadow: '0 0 4px 0 rgba(0, 0, 0, .1)',
      marginTop: '15px',
      padding: '19px',
    }}
  >
    {/* <KendoCardBody> */}
      <h4>This is a change</h4>
      {children}
    {/* </KendoCardBody> */}
  </KendoCard>
);

export default Card;
Wissam
Telerik team
commented on 11 Jul 2023, 08:07 AM

Hi, Jason,

Thank you for the provided code sample.

I tested it, but it was not showing any errors on my side. Therefore, could you please send me a runnable example where the issue

is reproduced so that I can assist you further? You can use my test demo as a base:

Regards,
Wissam
Progress Telerik

No answers yet. Maybe you can help?

Tags
Card
Asked by
Jason
Top achievements
Rank 1
Share this question
or