How to expose c++ enum class to react native #10624
              
                
                  
                  
                    Answered
                  
                  by
                    jonthysell
                  
              
          
                  
                    
                      ClaudiuHBann
                    
                  
                
                  asked this question in
                Q&A
              
            -
| 
         I have a enum class in C++ which looks like this: enum class CommandDetectionLevel : uint8_t
  {
    NONE,
    LOW,
    MEDIUM_LOW,
    MEDIUM_HIGH,
    HIGH
  };How can I expose this enum class from a module in react native?  | 
  
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            jonthysell
          
      
      
        Sep 29, 2022 
      
    
    Replies: 1 comment
-
| 
         You would want to expose the enum values as part of a native module's constants. You could specify "CommandDetectionLevel.NONE = 0", "CommandDetectionLevel.LOW = 1", etc.). See https://microsoft.github.io/react-native-windows/docs/native-modules  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        jonthysell
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
You would want to expose the enum values as part of a native module's constants. You could specify "CommandDetectionLevel.NONE = 0", "CommandDetectionLevel.LOW = 1", etc.).
See https://microsoft.github.io/react-native-windows/docs/native-modules