Skip to content

Commit

Permalink
Merge pull request #17071 from qmonmert/react/17064
Browse files Browse the repository at this point in the history
[React] Replace react-infinite-scroller by react-infinite-scroll-comp…
  • Loading branch information
DanielFran committed Nov 22, 2021
2 parents c324bb7 + 9d174ff commit ea9ac6a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
4 changes: 3 additions & 1 deletion generators/client/files-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const files = {
common: [
{
templates: [
'.npmrc',
'package.json',
'.eslintrc.json',
'tsconfig.json',
Expand Down Expand Up @@ -347,6 +346,9 @@ function cleanup() {
if (this.isJhipsterVersionLessThan('7.4.0') && this.enableI18nRTL) {
this.removeFile(`${CLIENT_MAIN_SRC_DIR}content/scss/rtl.scss`);
}
if (this.isJhipsterVersionLessThan('7.4.1')) {
this.removeFile('.npmrc');
}
}

function writeFiles() {
Expand Down
1 change: 0 additions & 1 deletion generators/client/templates/react/.npmrc.ejs

This file was deleted.

2 changes: 1 addition & 1 deletion generators/client/templates/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"mini-css-extract-plugin": "2.4.5",
"postcss-loader": "6.2.0",
"postcss-rtlcss": "3.5.0",
"react-infinite-scroller": "1.2.4",
"react-infinite-scroll-component": "6.1.0",
"redux-mock-store": "1.5.4",
"rimraf": "3.0.2",
"sass": "1.43.4",
Expand Down
2 changes: 1 addition & 1 deletion generators/client/templates/react/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<%_ if (protractorTests) { _%>
"protractor": "7.0.0",
<%_ } _%>
"react-infinite-scroller": "<%= dependabotPackageJson.devDependencies['react-infinite-scroller'] %>",
"react-infinite-scroll-component": "<%= dependabotPackageJson.devDependencies['react-infinite-scroll-component'] %>",
"redux-mock-store": "<%= dependabotPackageJson.devDependencies['redux-mock-store'] %>",
"rimraf": "<%= dependabotPackageJson.devDependencies['rimraf'] %>",
"sass": "<%= dependabotPackageJson.devDependencies['sass'] %>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-%>
import React, { useState, useEffect } from 'react';
<%_ if (paginationInfiniteScroll) { _%>
import InfiniteScroll from 'react-infinite-scroller';
import InfiniteScroll from 'react-infinite-scroll-component';
<%_ } _%>
import { Link, RouteComponentProps } from 'react-router-dom';
import { Button, <% if (searchEngine) { %>Input, InputGroup, FormGroup, Form, Row, Col, <% } %>Table } from 'reactstrap';
Expand Down Expand Up @@ -324,12 +324,10 @@ export const <%= entityReactName %> = (props: RouteComponentProps<{url: string}>
<%_ } _%>
<div className="table-responsive">
<%_ if (paginationInfiniteScroll) { _%>
<InfiniteScroll pageStart={paginationState.activePage}
loadMore={handleLoadMore}
<InfiniteScroll dataLength={<%= entityInstance %>List ? <%= entityInstance %>List.length : 0}
next={handleLoadMore}
hasMore={paginationState.activePage - 1 < links.next}
loader={<div className="loader">Loading ...</div>}
threshold={0}
initialLoad={false}>
loader={<div className="loader">Loading ...</div>}>
<%_ } _%>
{
<%= entityInstance %>List && <%= entityInstance %>List.length > 0 ?(
Expand Down
3 changes: 0 additions & 3 deletions test/__snapshots__/app.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9875,9 +9875,6 @@ Object {
".mvn/wrapper/maven-wrapper.properties": Object {
"stateCleared": "modified",
},
".npmrc": Object {
"stateCleared": "modified",
},
".prettierignore": Object {
"stateCleared": "modified",
},
Expand Down

0 comments on commit ea9ac6a

Please sign in to comment.