primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.97k stars 1.06k forks source link

OrganizationChart: Documentation issue in Basic and Template sections. #6070

Closed charithAmila closed 8 months ago

charithAmila commented 9 months ago

Describe the bug

  1. Basic, Typescript code example
import React, { useState } from 'react';
import { OrganizationChart } from 'primereact/organizationchart';
import { TreeNode } from 'primereact/treenode';

export default function BasicDoc() {
    const [data] = useState<TreeNode>([ // <-------------- This should be  <TreeNode[]>
        {
            label: 'Argentina',
            expanded: true,
            children: [
                {
                    label: 'Argentina',
                    expanded: true,
                    children: [
                        {
                            label: 'Argentina'
                        },
                        {
                            label: 'Croatia'
                        }
                    ]
                },
                {
                    label: 'France',
                    expanded: true,
                    children: [
                        {
                            label: 'France'
                        },
                        {
                            label: 'Morocco'
                        }
                    ]
                }
            ]
        }
    ]);

    return (
        <div className="card overflow-x-auto">
            <OrganizationChart value={data} />
        </div>
    )
}
  1. Same issue in the Template section.

Reproducer

No response

PrimeReact version

10.5.1

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to the Documentation Components section.
  2. Navigate to OrganizationChart Basic section.
  3. See typescript example code.
  4. See the same issue in the Template section.

Expected behavior

No response

melloware commented 9 months ago

PR is welcome!

charithAmila commented 9 months ago

I am working on it.