-
Notifications
You must be signed in to change notification settings - Fork 69
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
Crash app when back to the previous page #73
Comments
while wait for feedback you can try: https://levelup.gitconnected.com/integrating-facebook-customer-chat-into-a-react-js-app-5b7c21343048 :)) |
Hi @AnLuubk , Did you get the error like me ? |
i got both 2 error you just created today and i just hotfix by the link i just comment previous. May be facebook have new update that package works incorrectly :( |
@AnLuubk , Hi, thank you so much, I am follow this solution you mentioned above. |
you dont need to do the same just create component like this:
|
The ConfigContext just think it is a place to get your PageID and AppID constant, he manage those information using React context |
yes! for hiding data :) |
Hi, @AnLuubk , @khaphannm I am implementing it but now I got an error like this: |
you just put appId to direct value or empty string: "". facebook chat plugin does not need appId (i think)
|
Hi @thangdev Then just modify a bit like this (Add
|
Hi @khaphannm, |
@khaphannm The only problem now is the messenger doesn't hide when I click to navigate to other page, it's still there. |
Yes, you can choose which approach is easier for you, because this library is more convenient for controlling the props, when you need to custom your plugin. You can have a look this example, my component, and everything is just in one place, to set up your own plugin
|
you can check the pathname if this is the route you want to render Messenger |
Or you can try method show and hide like this: https://stackoverflow.com/a/64451277 |
this is better code but im not sure how the code deal with server render, it may crash before come to client. if it work can you explain more?? :) |
Server side rendering will return all needed content for u when receiving request, then cannot crash |
sure i think i still have to check if it is client render for script to load. Thank you for your help. I will refactor my code later! |
System Information
OS: Ubuntu 20.04 LTS
Browser: Chrome Version 89.0.4389.82
Context
Plugin was implemented in Reactjs v16.13.1
I set the appId="" (blank string) and the module still works well
Steps to replicate
When the page is loaded, the messenger work well but when I click go back button on browser to navigate to the previous page of my web, it crashes my web
The text was updated successfully, but these errors were encountered: