setProp action results in massive type definitions in large projects #2547
              
  
  Closed
              
          
                  
                    
                      sergioisidoro
                    
                  
                
                  started this conversation in
                General
              
            Replies: 1 comment
-
| Discussion to continue over at MST repo: mobxjs/mobx-state-tree#2115 | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I've started to hit a typescript limit
After a while of debugging, I finally realised that one of the culprits was
setPropas it was popping out over and over again in the type definitions. Not that it was a recursive issue (it did stop at some point), but having a somewhat deeply nested tree resulted in setProp type annotations to grow VERY rapidly on some cases.In this case a single

setPropin the type definitions has almost 600 lines.So I'm leaving this here as a navigation warning / Improvement idea - use
withSetPropActionseldomly, or make changes to the type annotations of that action.Beta Was this translation helpful? Give feedback.
All reactions