# give/4.18.0/src/Campaigns/Blocks/CampaignComments/resources/app.tsx

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 16 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/Campaigns/Blocks/CampaignComments/resources/app.tsx
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/Campaigns/Blocks/CampaignComments/resources/app.tsx
- Modified: 2025-04-16T13:25:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.18.0/code/src/Campaigns/Blocks/CampaignComments/resources/app.tsx#L10-L20`.

```tsx
import {createRoot} from '@wordpress/element';
import CampaignComments from './shared/components/CampaignComments';

const roots = document.querySelectorAll('[data-givewp-campaign-comments]');

if (roots) {
    roots.forEach((root) => {
        const attributes = root.getAttribute('data-attributes');
        const secondaryColor = root.getAttribute('data-secondary-color');

        return createRoot(root).render(
            <CampaignComments attributes={JSON.parse(attributes)} secondaryColor={secondaryColor} />
        );
    });
}

```
