Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

React-toastify does not display messages containing ReactElement translations #22809

Closed
1 task done
hide212131 opened this issue Jul 9, 2023 · 0 comments · Fixed by jhipster/react-jhipster#98
Closed
1 task done

Comments

@hide212131
Copy link
Contributor

hide212131 commented Jul 9, 2023

Overview of the issue

React-toastify does not display messages that contain ReactElement translations. For example, the toast notification is not displayed when using messages like this:

"success": "<strong>Settings saved!</strong>", 

However, it does get displayed for messages like this:

"success": "Settings saved!", 
Motivation for or Use Case

React-toastify does not display.

Reproduce the error

Navigate to the settings or user-management page, and press the update button.

Related issues

This issue seems to have been introduced by jhipster/react-jhipster#93.

Suggest a Fix

It appears that react-toastify supports multiple elements only when they are enclosed in Fragment tags (<></>).

JHipster Version(s)

since react-jhipster v0.24.0.

JHipster configuration
.yo-rc.json file
{
  "applicationType": "monolith",
  "authenticationType": "jwt",
  "baseName": "myApp",
  "buildTool": "maven",
  "cacheProvider": "ehcache",
  "clientFramework": "react",
  "clientTheme": "none",
  "creationTimestamp": 1688826943597,
  "cypressAudit": true,
  "cypressCoverage": null,
  "databaseType": "sql",
  "devDatabaseType": "h2Disk",
  "devServerPort": 9060,
  "dtoSuffix": "DTO",
  "enableGradleEnterprise": null,
  "enableHibernateCache": true,
  "enableSwaggerCodegen": false,
  "enableTranslation": true,
  "entities": [],
  "entitySuffix": "",
  "gradleEnterpriseHost": null,
  "jhiPrefix": "jhi",
  "jhipsterVersion": "8.0.0-beta.1",
  "languages": [
    "en",
    "fr"
  ],
  "messageBroker": false,
  "microfrontend": false,
  "microfrontends": [],
  "nativeLanguage": "en",
  "packageFolder": "com/mycompany/myapp",
  "packageName": "com.mycompany.myapp",
  "pages": [],
  "prodDatabaseType": "postgresql",
  "reactive": false,
  "searchEngine": false,
  "serverPort": null,
  "serverSideOptions": [],
  "serviceDiscoveryType": false,
  "skipCheckLengthOfIdentifier": false,
  "skipClient": false,
  "skipFakeData": false,
  "skipUserManagement": false,
  "testFrameworks": [
    "cypress"
  ],
  "websocket": false,
  "withAdminUi": true
}
Environment and Tools

java version "17.0.7" 2023-04-18 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.7+8.1 (build 17.0.7+8-LTS-jvmci-23.0-b12)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.7+8.1 (build 17.0.7+8-LTS-jvmci-23.0-b12, mixed mode, sharing)

git version 2.39.2 (Apple Git-143)

node: v20.2.0
npm: 9.6.6

Docker version 23.0.6, build ef23cbc

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants