Skip to content

Instantly share code, notes, and snippets.

@AriPerkkio
Created October 3, 2022 15:24
Show Gist options
  • Save AriPerkkio/22bb98633d367156d090dafe376444ac to your computer and use it in GitHub Desktop.
Save AriPerkkio/22bb98633d367156d090dafe376444ac to your computer and use it in GitHub Desktop.
react#25360, react-hooks/no-nested-components, react-table

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/expanding/src/App.js
  • Link
  90 |         // Build our expander column
  91 |         id: 'expander', // Make sure it has an ID
> 92 |         Header: ({ getToggleAllRowsExpandedProps, isAllRowsExpanded }) => (
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 93 |           <span {...getToggleAllRowsExpandedProps()}>
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 94 |             {isAllRowsExpanded ? '👇' : '👉'}
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 95 |           </span>
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 96 |         ),
     | ^^^^^^^^^^
  97 |         Cell: ({ row }) =>
  98 |           // Use the row.canExpand and row.getToggleRowExpandedProps prop getter
  99 |           // to build the toggle for expanding a row

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/expanding/src/App.js
  • Link
   95 |           </span>
   96 |         ),
>  97 |         Cell: ({ row }) =>
      |               ^^^^^^^^^^^^
>  98 |           // Use the row.canExpand and row.getToggleRowExpandedProps prop getter
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  99 |           // to build the toggle for expanding a row
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 100 |           row.canExpand ? (
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 101 |             <span
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 102 |               {...row.getToggleRowExpandedProps({
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 103 |                 style: {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 104 |                   // We can even use the row.depth property
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 105 |                   // and paddingLeft to indicate the depth
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 106 |                   // of the row
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 107 |                   paddingLeft: `${row.depth * 2}rem`,
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 108 |                 },
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 109 |               })}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 110 |             >
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 111 |               {row.isExpanded ? '👇' : '👉'}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 112 |             </span>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 113 |           ) : null,
      | ^^^^^^^^^^^^^^^^^^^
  114 |       },
  115 |       {
  116 |         Header: 'Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/full-width-resizable-table/src/App.js
  • Link
  147 |           // The header can use the table's getToggleAllRowsSelectedProps method
  148 |           // to render a checkbox
> 149 |           Header: ({ getToggleAllRowsSelectedProps }) => (
      |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 150 |             <div>
      | ^^^^^^^^^^^^^^^^^
> 151 |               <IndeterminateCheckbox {...getToggleAllRowsSelectedProps()} />
      | ^^^^^^^^^^^^^^^^^
> 152 |             </div>
      | ^^^^^^^^^^^^^^^^^
> 153 |           ),
      | ^^^^^^^^^^^^
  154 |           // The cell can use the individual row's getToggleRowSelectedProps method
  155 |           // to the render a checkbox
  156 |           Cell: ({ row }) => (

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/full-width-resizable-table/src/App.js
  • Link
  154 |           // The cell can use the individual row's getToggleRowSelectedProps method
  155 |           // to the render a checkbox
> 156 |           Cell: ({ row }) => (
      |                 ^^^^^^^^^^^^^^
> 157 |             <div>
      | ^^^^^^^^^^^^^^^^^
> 158 |               <IndeterminateCheckbox {...row.getToggleRowSelectedProps()} />
      | ^^^^^^^^^^^^^^^^^
> 159 |             </div>
      | ^^^^^^^^^^^^^^^^^
> 160 |           ),
      | ^^^^^^^^^^^^
  161 |         },
  162 |         ...columns,
  163 |       ]);

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/grouping-column/src/App.js
  • Link
  75 |             id: 'expander', // Make sure it has an ID
  76 |             // Build our expander column
> 77 |             Header: ({ allColumns, state: { groupBy } }) => {
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 78 |               return groupBy.map(columnId => {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 79 |                 const column = allColumns.find(d => d.id === columnId)
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 80 |
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 81 |                 return (
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 82 |                   <span {...column.getHeaderProps()}>
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 83 |                     {column.canGroupBy ? (
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 84 |                       // If the column can be grouped, let's add a toggle
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 85 |                       <span {...column.getGroupByToggleProps()}>
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 86 |                         {column.isGrouped ? '🛑 ' : '👊 '}
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 87 |                       </span>
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 88 |                     ) : null}
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 89 |                     {column.render('Header')}{' '}
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 90 |                   </span>
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 91 |                 )
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 92 |               })
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 93 |             },
     | ^^^^^^^^^^^^^^
  94 |             Cell: ({ row }) => {
  95 |               if (row.canExpand) {
  96 |                 const groupedCell = row.allCells.find(d => d.isGrouped)

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/grouping-column/src/App.js
  • Link
   92 |               })
   93 |             },
>  94 |             Cell: ({ row }) => {
      |                   ^^^^^^^^^^^^^^
>  95 |               if (row.canExpand) {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  96 |                 const groupedCell = row.allCells.find(d => d.isGrouped)
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  97 |
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  98 |                 return (
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  99 |                   <span
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 100 |                     {...row.getToggleRowExpandedProps({
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 101 |                       style: {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 102 |                         // We can even use the row.depth property
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 103 |                         // and paddingLeft to indicate the depth
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 104 |                         // of the row
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 105 |                         paddingLeft: `${row.depth * 2}rem`,
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 106 |                       },
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 107 |                     })}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 108 |                   >
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 109 |                     {row.isExpanded ? '👇' : '👉'} {groupedCell.render('Cell')}{' '}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 110 |                     ({row.subRows.length})
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 111 |                   </span>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 112 |                 )
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 113 |               }
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 114 |
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 115 |               return null
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 116 |             },
      | ^^^^^^^^^^^^^^
  117 |           },
  118 |           ...columns,
  119 |         ]

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/grouping-column/src/App.js
  • Link
  261 |             // aggregated further
  262 |             aggregate: 'count',
> 263 |             Aggregated: ({ value }) => `${value} Names`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  264 |           },
  265 |           {
  266 |             Header: 'Last Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/grouping-column/src/App.js
  • Link
  271 |             // they are aggregated further
  272 |             aggregate: 'uniqueCount',
> 273 |             Aggregated: ({ value }) => `${value} Unique Names`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  274 |           },
  275 |         ],
  276 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/grouping-column/src/App.js
  • Link
  283 |             // Aggregate the average age of visitors
  284 |             aggregate: 'average',
> 285 |             Aggregated: ({ value }) => `${value} (avg)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  286 |           },
  287 |           {
  288 |             Header: 'Visits',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/grouping-column/src/App.js
  • Link
  290 |             // Aggregate the sum of all visits
  291 |             aggregate: 'sum',
> 292 |             Aggregated: ({ value }) => `${value} (total)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  293 |           },
  294 |           {
  295 |             Header: 'Status',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/grouping-column/src/App.js
  • Link
  301 |             // Use our custom roundedMedian aggregator
  302 |             aggregate: roundedMedian,
> 303 |             Aggregated: ({ value }) => `${value} (med)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  304 |           },
  305 |         ],
  306 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink/src/App.js
  • Link
  324 |             // The header can use the table's getToggleAllRowsSelectedProps method
  325 |             // to render a checkbox
> 326 |             Header: ({ getToggleAllRowsSelectedProps }) => (
      |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 327 |               <div>
      | ^^^^^^^^^^^^^^^^^^^
> 328 |                 <IndeterminateCheckbox {...getToggleAllRowsSelectedProps()} />
      | ^^^^^^^^^^^^^^^^^^^
> 329 |               </div>
      | ^^^^^^^^^^^^^^^^^^^
> 330 |             ),
      | ^^^^^^^^^^^^^^
  331 |             // The cell can use the individual row's getToggleRowSelectedProps method
  332 |             // to the render a checkbox
  333 |             Cell: ({ row }) => (

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink/src/App.js
  • Link
  331 |             // The cell can use the individual row's getToggleRowSelectedProps method
  332 |             // to the render a checkbox
> 333 |             Cell: ({ row }) => (
      |                   ^^^^^^^^^^^^^^
> 334 |               <div>
      | ^^^^^^^^^^^^^^^^^^^
> 335 |                 <IndeterminateCheckbox {...row.getToggleRowSelectedProps()} />
      | ^^^^^^^^^^^^^^^^^^^
> 336 |               </div>
      | ^^^^^^^^^^^^^^^^^^^
> 337 |             ),
      | ^^^^^^^^^^^^^^
  338 |           },
  339 |           ...columns,
  340 |         ]

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink/src/App.js
  • Link
  541 |             // aggregated further
  542 |             aggregate: 'count',
> 543 |             Aggregated: ({ value }) => `${value} Names`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  544 |           },
  545 |           {
  546 |             Header: 'Last Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink/src/App.js
  • Link
  553 |             // they are aggregated further
  554 |             aggregate: 'uniqueCount',
> 555 |             Aggregated: ({ value }) => `${value} Unique Names`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  556 |           },
  557 |         ],
  558 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink/src/App.js
  • Link
  567 |             // Aggregate the average age of visitors
  568 |             aggregate: 'average',
> 569 |             Aggregated: ({ value }) => `${value} (avg)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  570 |           },
  571 |           {
  572 |             Header: 'Visits',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink/src/App.js
  • Link
  576 |             // Aggregate the sum of all visits
  577 |             aggregate: 'sum',
> 578 |             Aggregated: ({ value }) => `${value} (total)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  579 |           },
  580 |           {
  581 |             Header: 'Status',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink/src/App.js
  • Link
  591 |             // Use our custom roundedMedian aggregator
  592 |             aggregate: roundedMedian,
> 593 |             Aggregated: ({ value }) => `${value} (med)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  594 |           },
  595 |         ],
  596 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink-controlled/src/App.tsx
  • Link
  514 |             // aggregated further
  515 |             aggregate: 'count',
> 516 |             Aggregated: ({ value }) => `${value} Names`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  517 |           },
  518 |           {
  519 |             Header: 'Last Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink-controlled/src/App.tsx
  • Link
  526 |             // they are aggregated further
  527 |             aggregate: 'uniqueCount',
> 528 |             Aggregated: ({ value }) => `${value} Unique Names`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  529 |           },
  530 |         ],
  531 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink-controlled/src/App.tsx
  • Link
  540 |             // Aggregate the average age of visitors
  541 |             aggregate: 'average',
> 542 |             Aggregated: ({ value }) => `${value} (avg)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  543 |           },
  544 |           {
  545 |             Header: 'Visits',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink-controlled/src/App.tsx
  • Link
  549 |             // Aggregate the sum of all visits
  550 |             aggregate: 'sum',
> 551 |             Aggregated: ({ value }) => `${value} (total)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  552 |           },
  553 |           {
  554 |             Header: 'Status',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/kitchen-sink-controlled/src/App.tsx
  • Link
  564 |             // Use our custom roundedMedian aggregator
  565 |             aggregate: roundedMedian,
> 566 |             Aggregated: ({ value }) => `${value} (med)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  567 |           },
  568 |         ],
  569 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/material-UI-enhanced-table/src/components/EnhancedTable.js
  • Link
  143 |           // rows in most cases.  The client should only download data for the current page.
  144 |           // In that case, getToggleAllRowsSelectedProps works fine.
> 145 |           Header: ({ getToggleAllRowsSelectedProps }) => (
      |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 146 |             <div>
      | ^^^^^^^^^^^^^^^^^
> 147 |               <IndeterminateCheckbox {...getToggleAllRowsSelectedProps()} />
      | ^^^^^^^^^^^^^^^^^
> 148 |             </div>
      | ^^^^^^^^^^^^^^^^^
> 149 |           ),
      | ^^^^^^^^^^^^
  150 |           // The cell can use the individual row's getToggleRowSelectedProps method
  151 |           // to the render a checkbox
  152 |           Cell: ({ row }) => (

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/material-UI-enhanced-table/src/components/EnhancedTable.js
  • Link
  150 |           // The cell can use the individual row's getToggleRowSelectedProps method
  151 |           // to the render a checkbox
> 152 |           Cell: ({ row }) => (
      |                 ^^^^^^^^^^^^^^
> 153 |             <div>
      | ^^^^^^^^^^^^^^^^^
> 154 |               <IndeterminateCheckbox {...row.getToggleRowSelectedProps()} />
      | ^^^^^^^^^^^^^^^^^
> 155 |             </div>
      | ^^^^^^^^^^^^^^^^^
> 156 |           ),
      | ^^^^^^^^^^^^
  157 |         },
  158 |         ...columns,
  159 |       ])

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/pivoting/src/App.js
  • Link
  234 |         sortingFn: 'basic',
  235 |         aggregate: 'count',
> 236 |         Cell: ({ value }) => (value ? dayjs(value).format('l') : ''),
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  237 |         Aggregated: ({ value }) => `${value} Orders`,
  238 |       },
  239 |       {

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/pivoting/src/App.js
  • Link
  235 |         aggregate: 'count',
  236 |         Cell: ({ value }) => (value ? dayjs(value).format('l') : ''),
> 237 |         Aggregated: ({ value }) => `${value} Orders`,
      |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  238 |       },
  239 |       {
  240 |         Header: 'Employee',

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/pivoting/src/App.js
  • Link
  261 |         accessor: 'unitCost',
  262 |         aggregate: 'average',
> 263 |         Cell: ({ value }) =>
      |               ^^^^^^^^^^^^^^
> 264 |           typeof value !== 'undefined' ? (
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 265 |             <div
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 266 |               style={{ textAlign: 'right', fontVariantNumeric: 'tabular-nums' }}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 267 |             >
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 268 |               ${(Math.floor(value * 100) / 100).toLocaleString()}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 269 |             </div>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 270 |           ) : null,
      | ^^^^^^^^^^^^^^^^^^^
  271 |       },
  272 |       {
  273 |         Header: 'Total',

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/pivoting/src/App.js
  • Link
  274 |         accessor: 'total',
  275 |         aggregate: 'sum',
> 276 |         Cell: ({ value }) =>
      |               ^^^^^^^^^^^^^^
> 277 |           typeof value !== 'undefined' ? (
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 278 |             <div
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 279 |               style={{ textAlign: 'right', fontVariantNumeric: 'tabular-nums' }}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 280 |             >
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 281 |               ${(Math.floor(value * 100) / 100).toLocaleString()}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 282 |             </div>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 283 |           ) : null,
      | ^^^^^^^^^^^^^^^^^^^
  284 |       },
  285 |     ],
  286 |     []

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/sub-components/src/App.js
  • Link
  117 |       {
  118 |         // Make an expander cell
> 119 |         Header: () => null, // No header
      |                 ^^^^^^^^^^
  120 |         id: 'expander', // It needs an ID
  121 |         Cell: ({ row }) => (
  122 |           // Use Cell to render an expander for each row.

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/sub-components/src/App.js
  • Link
  119 |         Header: () => null, // No header
  120 |         id: 'expander', // It needs an ID
> 121 |         Cell: ({ row }) => (
      |               ^^^^^^^^^^^^^^
> 122 |           // Use Cell to render an expander for each row.
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 123 |           // We can use the getToggleRowExpandedProps prop-getter
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 124 |           // to build the expander.
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 125 |           <span {...row.getToggleRowExpandedProps()}>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 126 |             {row.isExpanded ? '👇' : '👉'}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 127 |           </span>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 128 |         ),
      | ^^^^^^^^^^
  129 |       },
  130 |       {
  131 |         Header: 'Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/sub-components-lazy/src/App.js
  • Link
  173 |       {
  174 |         // Make an expander cell
> 175 |         Header: () => null, // No header
      |                 ^^^^^^^^^^
  176 |         id: 'expander', // It needs an ID
  177 |         Cell: ({ row }) => (
  178 |           // Use Cell to render an expander for each row.

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/sub-components-lazy/src/App.js
  • Link
  175 |         Header: () => null, // No header
  176 |         id: 'expander', // It needs an ID
> 177 |         Cell: ({ row }) => (
      |               ^^^^^^^^^^^^^^
> 178 |           // Use Cell to render an expander for each row.
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 179 |           // We can use the getToggleRowExpandedProps prop-getter
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 180 |           // to build the expander.
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 181 |           <span {...row.getToggleRowExpandedProps()}>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 182 |             {row.isExpanded ? '👇' : '👉'}
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 183 |           </span>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 184 |         ),
      | ^^^^^^^^^^
  185 |         // We can override the cell renderer with a SubCell to be used with an expanded row
  186 |         SubCell: () => null // No expander on an expanded row
  187 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "SubCell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/sub-components-lazy/src/App.js
  • Link
  184 |         ),
  185 |         // We can override the cell renderer with a SubCell to be used with an expanded row
> 186 |         SubCell: () => null // No expander on an expanded row
      |                  ^^^^^^^^^^
  187 |       },
  188 |       {
  189 |         Header: 'Name',

Rule: react-hooks/no-nested-components

  • Message: Component "SubCell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/old-examples/sub-components-lazy/src/App.js
  • Link
  194 |             accessor: (d) => d.firstName,
  195 |             // We can render something different for subRows
> 196 |             SubCell: (cellProps) => (
      |                      ^^^^^^^^^^^^^^^^
> 197 |               <>🥳 {cellProps.value} 🎉</>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 198 |             )
      | ^^^^^^^^^^^^^^
  199 |           },
  200 |           {
  201 |             Header: 'Last Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useExpanded.notest.js
  • Link
  68 |     () => [
  69 |       {
> 70 |         Header: () => null,
     |                 ^^^^^^^^^^
  71 |         id: 'expander',
  72 |         Cell: ({ row }) => (
  73 |           <span

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useExpanded.notest.js
  • Link
  70 |         Header: () => null,
  71 |         id: 'expander',
> 72 |         Cell: ({ row }) => (
     |               ^^^^^^^^^^^^^^
> 73 |           <span
     | ^^^^^^^^^^^^^^^
> 74 |             style={{
     | ^^^^^^^^^^^^^^^
> 75 |               cursor: 'pointer',
     | ^^^^^^^^^^^^^^^
> 76 |               paddingLeft: `${row.depth * 2}rem`,
     | ^^^^^^^^^^^^^^^
> 77 |             }}
     | ^^^^^^^^^^^^^^^
> 78 |             onClick={() => row.toggleRowExpanded()}
     | ^^^^^^^^^^^^^^^
> 79 |           >
     | ^^^^^^^^^^^^^^^
> 80 |             {row.isExpanded ? 'Collapse' : 'Expand'} Row {row.id}
     | ^^^^^^^^^^^^^^^
> 81 |           </span>
     | ^^^^^^^^^^^^^^^
> 82 |         ),
     | ^^^^^^^^^^
  83 |       },
  84 |       {
  85 |         Header: 'First Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useExpanded.notest.js
  • Link
  85 |         Header: 'First Name',
  86 |         accessor: 'name',
> 87 |         Cell: ({ row: { id } }) => `Row ${id}`,
     |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  88 |       },
  89 |     ],
  90 |     []

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useFiltersAndRowSelect.notest.js
  • Link
  137 |         // The header can use the table's getToggleAllRowsSelectedProps method
  138 |         // to render a checkbox
> 139 |         Header: ({ getToggleAllRowsSelectedProps }) => (
      |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 140 |           <div>
      | ^^^^^^^^^^^^^^^
> 141 |             <label>
      | ^^^^^^^^^^^^^^^
> 142 |               <IndeterminateCheckbox {...getToggleAllRowsSelectedProps()} />{' '}
      | ^^^^^^^^^^^^^^^
> 143 |               Select All
      | ^^^^^^^^^^^^^^^
> 144 |             </label>
      | ^^^^^^^^^^^^^^^
> 145 |           </div>
      | ^^^^^^^^^^^^^^^
> 146 |         ),
      | ^^^^^^^^^^
  147 |         // The cell can use the individual row's getToggleRowSelectedProps method
  148 |         // to the render a checkbox
  149 |         Cell: ({ row }) => (

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useFiltersAndRowSelect.notest.js
  • Link
  147 |         // The cell can use the individual row's getToggleRowSelectedProps method
  148 |         // to the render a checkbox
> 149 |         Cell: ({ row }) => (
      |               ^^^^^^^^^^^^^^
> 150 |           <div>
      | ^^^^^^^^^^^^^^^
> 151 |             <label>
      | ^^^^^^^^^^^^^^^
> 152 |               <IndeterminateCheckbox {...row.getToggleRowSelectedProps()} />{' '}
      | ^^^^^^^^^^^^^^^
> 153 |               Select Row
      | ^^^^^^^^^^^^^^^
> 154 |             </label>
      | ^^^^^^^^^^^^^^^
> 155 |           </div>
      | ^^^^^^^^^^^^^^^
> 156 |         ),
      | ^^^^^^^^^^
  157 |       },
  158 |       {
  159 |         id: 'selectedStatus',

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useFiltersAndRowSelect.notest.js
  • Link
  158 |       {
  159 |         id: 'selectedStatus',
> 160 |         Cell: ({ row }) => (
      |               ^^^^^^^^^^^^^^
> 161 |           <div>
      | ^^^^^^^^^^^^^^^
> 162 |             Row {row.id} {row.isSelected ? 'Selected' : 'Not Selected'}
      | ^^^^^^^^^^^^^^^
> 163 |           </div>
      | ^^^^^^^^^^^^^^^
> 164 |         ),
      | ^^^^^^^^^^
  165 |       },
  166 |       {
  167 |         Header: 'Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  156 |             accessor: 'firstName',
  157 |             aggregate: 'count',
> 158 |             Aggregated: ({ value }) => `First Name Aggregated: ${value} Names`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  159 |           },
  160 |           {
  161 |             Header: 'Last Name',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  162 |             accessor: 'lastName',
  163 |             aggregate: 'uniqueCount',
> 164 |             Aggregated: ({ value }) =>
      |                         ^^^^^^^^^^^^^^
> 165 |               `Last Name Aggregated: ${value} Unique Names`,
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  166 |           },
  167 |         ],
  168 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  174 |             accessor: 'age',
  175 |             aggregate: 'average',
> 176 |             Aggregated: ({ value }) => `Age Aggregated: ${value} (avg)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  177 |           },
  178 |           {
  179 |             Header: 'Visits',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  180 |             accessor: 'visits',
  181 |             aggregate: 'sum',
> 182 |             Aggregated: ({ value }) => `Visits Aggregated: ${value} (total)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  183 |           },
  184 |           {
  185 |             Header: 'Min Visits',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  187 |             accessor: 'visits',
  188 |             aggregate: 'min',
> 189 |             Aggregated: ({ value }) => `Visits Aggregated: ${value} (min)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  190 |           },
  191 |           {
  192 |             Header: 'Max Visits',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  194 |             accessor: 'visits',
  195 |             aggregate: 'max',
> 196 |             Aggregated: ({ value }) => `Visits Aggregated: ${value} (max)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  197 |           },
  198 |           {
  199 |             Header: 'Min/Max Visits',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  201 |             accessor: 'visits',
  202 |             aggregate: 'minMax',
> 203 |             Aggregated: ({ value }) => `Visits Aggregated: ${value} (minMax)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  204 |           },
  205 |           {
  206 |             Header: 'Status',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  207 |             accessor: 'status',
  208 |             aggregate: 'unique',
> 209 |             Aggregated: ({ value }) =>
      |                         ^^^^^^^^^^^^^^
> 210 |               `Visits Aggregated: ${value.join(', ')} (unique)`,
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  211 |           },
  212 |           {
  213 |             Header: 'Profile Progress (Median)',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  215 |             id: 'progress',
  216 |             aggregate: 'median',
> 217 |             Aggregated: ({ value }) => `Process Aggregated: ${value} (median)`,
      |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  218 |           },
  219 |           {
  220 |             Header: 'Profile Progress (Rounded Median)',

Rule: react-hooks/no-nested-components

  • Message: Component "Aggregated" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useGroupBy.notest.js
  • Link
  222 |             id: 'progressRounded',
  223 |             aggregate: roundedMedian,
> 224 |             Aggregated: ({ value }) =>
      |                         ^^^^^^^^^^^^^^
> 225 |               `Process Aggregated: ${value} (rounded median)`,
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  226 |           },
  227 |         ],
  228 |       },

Rule: react-hooks/no-nested-components

  • Message: Component "Header" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useRowSelect.notest.js
  • Link
  85 |             // The header can use the table's getToggleAllRowsSelectedProps method
  86 |             // to render a checkbox
> 87 |             Header: ({ table: { getToggleAllRowsSelectedProps } }) => (
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 88 |               <div>
     | ^^^^^^^^^^^^^^^^^^^
> 89 |                 <label>
     | ^^^^^^^^^^^^^^^^^^^
> 90 |                   <IndeterminateCheckbox {...getToggleAllRowsSelectedProps()} />{' '}
     | ^^^^^^^^^^^^^^^^^^^
> 91 |                   Select All
     | ^^^^^^^^^^^^^^^^^^^
> 92 |                 </label>
     | ^^^^^^^^^^^^^^^^^^^
> 93 |               </div>
     | ^^^^^^^^^^^^^^^^^^^
> 94 |             ),
     | ^^^^^^^^^^^^^^
  95 |             // The cell can use the individual row's getToggleRowSelectedProps method
  96 |             // to the render a checkbox
  97 |             Cell: ({ row }) => (

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useRowSelect.notest.js
  • Link
   95 |             // The cell can use the individual row's getToggleRowSelectedProps method
   96 |             // to the render a checkbox
>  97 |             Cell: ({ row }) => (
      |                   ^^^^^^^^^^^^^^
>  98 |               <div>
      | ^^^^^^^^^^^^^^^^^^^
>  99 |                 <label>
      | ^^^^^^^^^^^^^^^^^^^
> 100 |                   <IndeterminateCheckbox {...row.getToggleRowSelectedProps()} />{' '}
      | ^^^^^^^^^^^^^^^^^^^
> 101 |                   Select Row
      | ^^^^^^^^^^^^^^^^^^^
> 102 |                 </label>
      | ^^^^^^^^^^^^^^^^^^^
> 103 |               </div>
      | ^^^^^^^^^^^^^^^^^^^
> 104 |             ),
      | ^^^^^^^^^^^^^^
  105 |           },
  106 |           ...columns,
  107 |         ])

Rule: react-hooks/no-nested-components

  • Message: Component "Cell" is declared during render. You should move this declaration outside of render to ensure this component's state is persisted across re-renders of its parent. If this component is memoized, you should still refactor the component to be able to move it outside of render. If you want to reset its state use a key instead (see https://reactjs.org/docs/lists-and-keys.html#keys).
  • Path: tannerlinsley/react-table/packages/react-table/__tests__/features/useRowSelect.notest.js
  • Link
  159 |       {
  160 |         id: 'selectedStatus',
> 161 |         Cell: ({ row }) =>
      |               ^^^^^^^^^^^^
> 162 |           row.isSelected ? (
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 163 |             <div>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 164 |               <div>Selected</div>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 165 |               <div>Row {row.id}</div>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 166 |             </div>
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 167 |           ) : null,
      | ^^^^^^^^^^^^^^^^^^^
  168 |       },
  169 |       {
  170 |         Header: 'Name',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment