Use this tag for questions about PrimeReact, a collection of UI Components for React.js. Questions tagged [primereact] should also be tagged [reactjs], but NOT [primefaces].
Questions tagged [primereact]
296 questions
1
vote
2 answers
Convert array to tree array in javascript
I have a Tree array of objects and I want to convert it to use it into my primeReact component
This is my input data :
[
{
name: "My name",
Myid: "1",
children: [],
type: "type1",
label: "Mylabel",
function:…

Tania12
- 323
- 2
- 16
1
vote
1 answer
Trigger toast from another React component
I'm using PrimeReact toast element.
The index.js file:
import Dialogs from './components/Dialogs';
import React, { useRef } from 'react';
import { Toast } from 'primereact/toast';
const Index = () => {
const toast = useRef(null);
...
…

Mehdi Rahimi
- 1,453
- 5
- 20
- 31
1
vote
1 answer
Prime React Date not showing
I am using prime reacts component library. I'm trying to use the calendar component https://primereact.org/calendar/ but can not figure out how to set the default value (initial value) of the calendar. I tried creating a hardcoded state but it just…

Katherine Pacheco
- 339
- 3
- 7
- 24
1
vote
0 answers
primereact overlay components (dialog, sidebar) - inconsistent bug - Maximum update depth exceeded
So we have a primereact components based app,
and the problem occurs when triggering the show of an overlay component
(usually a Dialog, but I've noticed it could also happen with Sidebar),
in a specific page that concerns with showing a table and…

drdv
- 23
- 8
1
vote
2 answers
Prime React Chart Axios data does not load
I try to load data in a graph using a rest api, but it doesn't load for some reason,
can you help me
this is the data that the api brings
{
"avg_soc_fleet": 74.85
}
here is the code
const Rem = () => {
const [avgSoc, SetAvgSoc] = useState({});
…

Hugo Urbina
- 27
- 3
1
vote
1 answer
primereact, How to show all rows in pagination
Actually I am trying to show all rows in my PrimeReact Datatable components, however I cannot find how to show all rows.
When I hit…

Hayk Kirakosyan
- 21
- 1
1
vote
2 answers
PrimeReact Autocomplete - Disable option after selection
How to disable the selected option in the list of options in autocomplete PrimeReact?
For example, after selecting an option "Afghanistan", it should be disabled right away.
CodeSandbox:
Code Sample:
export const AutoCompleteDemo = () => {
//...
…

jhon26
- 313
- 2
- 11
1
vote
1 answer
Primereact Galleria. Undefined Variable after last image
I'm getting Cannot read properties of undefined (reading 'itemImageSrc') error after the last image.
Here is my code
const carousel = () => {
const [images, setImages] = useState(null);
useEffect(() => {
setImages([
{
…

ampol
- 17
- 6
1
vote
1 answer
how to change height DataTable PrimeReact
I can't stretch the table to the entire height of the block, even with one record
I am using PrimeReact in my app, here is my code:

DoNegative
- 21
- 5
1
vote
4 answers
Trigger toast from outside React component
I am using PrimeReact's toast component, whose API looks like this:
function App() {
const toast = useRef(null);
useEffect(() => {
toast.current.show({
severity: 'info',
detail: 'Hellope'
});
});
return (

DanielM
- 1,106
- 3
- 17
- 27
1
vote
1 answer
Add a title beside MultiSelect SelectAll Checkbox in prime react
I have a project with nextjs and typescript.In this project I use primereact as UI kit. my problem is I want add a text beside MultiSelect select all checkbox. something like this
Prime react add a prop as panelHeaderTemplate but I can't figure out…

Ali Ehyaie
- 1,116
- 3
- 13
- 27
1
vote
1 answer
How to show a row as a highlight while selected ids are getting from Props in React
I have added an array of employees into the Datatable, while clicking on each row the selected row is highlighted in the table
And the selected rows marker is visible on the map,
But now i want to highlight the table row whenever click on any marker…

ravi
- 11
- 2
1
vote
1 answer
Are PrimeReact 4 and React 17 compatible?
Good morning all,
I was wondering if anyone has a migration path from an older version of PrimeReact (v4) to work with React 17. We are trying to update our project to React 17, but the Menu component appears to have a “document.addEventListener”…

Eric
- 91
- 2
- 9
1
vote
1 answer
PrimeReact using built in Charts and Google Charts together
I'm using primereact and react-google-charts. However, they both want me to call the components as Charts. When I write a chart, I get an error. What solution should I…

SelimSezer
- 29
- 6
1
vote
2 answers
Submit form from sibling element in React
I am trying to use a library but a submit button would be rendered outside of the form automatically (because body of the library's component is rendered as a sibling of the footer where the submit button should go). Is there a way to bind to this…

Marc Sloth Eastman
- 693
- 1
- 10
- 19