Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

bug: Lifecycle events never be fired on React.FC #20071

Closed
pjc0247 opened this issue Dec 12, 2019 · 5 comments · Fixed by wo-ist-henry/DriveWithMe#41
Closed

bug: Lifecycle events never be fired on React.FC #20071

pjc0247 opened this issue Dec 12, 2019 · 5 comments · Fixed by wo-ist-henry/DriveWithMe#41
Labels
package: react @ionic/react package

Comments

@pjc0247
Copy link

pjc0247 commented Dec 12, 2019

Bug Report

Ionic version:
[x] 4.x

Current behavior:
I'm trying to receive lifecycle events following your documentation:
https://ionicframework.com/docs/react/lifecycle

https://github.com/pjc0247/bugreport/blob/master/src/pages/Home.tsx#L6

Expected behavior:
console log will be printed.

Steps to reproduce:
https://pjc0247.github.io/bugreport/build/index.html

Related code:
https://github.com/pjc0247/bugreport/blob/master/src/pages/Home.tsx#L6

Other information:

Ionic info:

Ionic:

   Ionic CLI       : 5.4.12 (C:\Users\pjc02\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework : @ionic/react 4.11.6

Utility:

   cordova-res : 0.6.0
   native-run  : 0.2.8

System:

   NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.9.0
   OS     : Windows 10

@ionitron-bot ionitron-bot bot added the triage label Dec 12, 2019
@elylucas elylucas added the package: react @ionic/react package label Dec 12, 2019
@ionitron-bot ionitron-bot bot removed the triage label Dec 12, 2019
@obedm503
Copy link
Contributor

@pjc0247 beat me to it

This was introduced in ionic 4.11.6, version 4.11.5 works perfectly fine.
Here's another repo to reproduce the issue by comparing the 2 versions https://github.com/obedm503/ionic-hooks-broken

From what I've noticed this is only an issue on the first render, lifecycle hooks still work when navigating to other pages and back.

@elylucas
Copy link
Contributor

Thanks,

I've found the issue and am working on a fix. Hopefully will be out later today.

@elylucas
Copy link
Contributor

fixed and released in 4.11.7, thanks for reporting!

@obedm503
Copy link
Contributor

can confirm it's working now

@ionitron-bot
Copy link

ionitron-bot bot commented Jan 12, 2020

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jan 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: react @ionic/react package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants