import React, { useState } from 'react'; import { Button } from 'primereact/button'; import { SplitButton } from 'primereact/splitbutton'; const ButtonDemo = () => { const [loading1, setLoading1] = useState(false); const [loading2, setLoading2] = useState(false); const [loading3, setLoading3] = useState(false); const [loading4, setLoading4] = useState(false); const onLoadingClick1 = () => { setLoading1(true); setTimeout(() => { setLoading1(false); }, 2000); } const onLoadingClick2 = () => { setLoading2(true); setTimeout(() => { setLoading2(false); }, 2000); } const onLoadingClick3 = () => { setLoading3(true); setTimeout(() => { setLoading3(false); }, 2000); } const onLoadingClick4 = () => { setLoading4(true); setTimeout(() => { setLoading4(false); }, 2000); } const items = [ { label: 'Update', icon: 'pi pi-refresh' }, { label: 'Delete', icon: 'pi pi-times' }, { label: 'Home', icon: 'pi pi-home' } ]; return (
Default
Severities
Text
Outlined
Button Group
SplitButton
Icons
Raised
Rounded
Rounded Icons
Rounded Text
Rounded Outlined
Loading
) } const comparisonFn = function (prevProps, nextProps) { return prevProps.location.pathname === nextProps.location.pathname; }; export default React.memo(ButtonDemo, comparisonFn);