stephenLYZ opened a new pull request #18658:
URL: https://github.com/apache/superset/pull/18658


   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   This problem only exists in dev environments. The reason is the 
react-hot-loader will use "ProxyFacade", which is a wrapper for Functional 
Component. 
   
   ```
   ProxyFacade = function(props, context) {
         /*
   
           ! THIS IS NOT YOUR COMPONENT !
           !  THIS IS REACT-HOT-LOADER  !
   
           And you are probably looking for a function component of yours
           It's hidden, but there is a way to fix this - just reconfigure your 
application a bit
           see https://github.com/gaearon/react-hot-loader/issues/1311
   
          */
   
         const result = CurrentComponent(props, context);
   ```
   
   And we use`recurseReactClone` method to create component(see 
https://github.com/apache/superset/blob/master/superset-frontend/src/CRUD/utils.js),
 which will pass props to the component. In this case, since the name has been 
changed, it is not possible to pass onChange props. see screenshot:
   
![image](https://user-images.githubusercontent.com/11830681/153377996-ae70e19a-7e49-4a08-87a3-f09684c995c6.png)
   
   Here we use this solution. 
https://github.com/gaearon/react-hot-loader/issues/1311
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   ### befre
   
https://user-images.githubusercontent.com/33317356/153366245-f733f6b6-c7c1-4322-b16a-91eb1d156b1c.mp4
   ### after
   
   
https://user-images.githubusercontent.com/11830681/153376126-886fd66b-9bc1-4d32-bae8-86d1b256e04b.mov
   
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: https://github.com/apache/superset/issues/18655
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to