Closed
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
Upgraded application use to ionic v6 and react v18 and followed the official upgrade guide to react v18:
// https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis
// Before
import { render } from 'react-dom';
const container = document.getElementById('app');
render(<App tab="home" />, container);
// After
import { createRoot } from 'react-dom/client';
const container = document.getElementById('app');
const root = createRoot(container); // createRoot(container!) if you use TypeScript
root.render(<App tab="home" />);
After updating to client renderings, the <IonAlert />
component do not open/render anymore.
Expected Behavior
Expect <IonAlert />
component to open/render
Steps to Reproduce
Following the Stackblitz example:
- Click the button
Show Alert Hook
to open the alert modal viauseIonAlert
-> Alert modal open - Click the button
Show Alert Component
to open the alert modal as a component -> Alert modal not open - Open the
index.js
file and switch the comments block to useReactDOM.render()
- Click the button
Show Alert Component
to open the alert modal as a component -> Alert modal open
Code Reproduction URL
https://stackblitz.com/edit/react-1udk9j-3drnwb?file=index.js
Ionic Info
Ionic:
Ionic CLI : 6.19.0 (/home/USERNAME/.nvm/versions/node/v16.15.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 6.1.4
Capacitor:
Capacitor CLI : 3.5.1
@capacitor/android : not installed
@capacitor/core : 3.5.1
@capacitor/ios : not installed
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v16.15.0 (/home/USERNAME/.nvm/versions/node/v16.15.0/bin/node)
npm : 8.8.0
OS : Linux 5.10
Additional Information
Same bug as #25118 but with a code example