Page 1 of 1

Simplify component import

Posted: 28 Sep 2017, 17:40
by norb7492
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';

Re: Simplify component import

Posted: 03 Oct 2017, 20:55
by cagatay.civici
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.