Simplify component import

UI Components for React
Post Reply
norb7492
Posts: 1
Joined: 28 Sep 2017, 17:34

28 Sep 2017, 17:40

Instead of importing

Code: Select all

import {Button} from 'primereact/components/button/Button';
would be better just to import

Code: Select all

import {Button} from 'primereact'
for this, would be good creating an index that exports all components, like

Code: Select all

export {Button} from 'primereact/components/button/Button';

cagatay.civici
Prime
Posts: 18146
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 Oct 2017, 20:55

We had this at PrimeNG but problem is when you import Button, you also get stuff that you don't use resulting in a bigger bundles with useless imports so it is better to use it as it now, or maybe we can create 'primereact/button' where button.js imports from the actual path.

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest