How iou90/react-native-autoheight-webview works
Main Components Structure
• Create three main vertical sections:
a. Consumer Application Layer (Top)
b. React Native Auto Height WebView Component (Middle)
c. Platform-Specific Implementation Layer (Bottom)
Component Architecture Details
Core Component Layer:
• It to a 'Utils' module (utils.js)
• TypeScript definitions (index.d.ts) as a side connection
Platform Implementation Layer:
• Create two parallel sections for iOS and Android implementations
• Integration with react-native-webview as a dependency
• Native bridge connections
Data Flow Representation
• Props flow from parent to component
• Height/width calculations flow up through onSizeUpdated callback
• Custom script and style injections into WebView
• File loading paths for both platforms
Key Integration Points
• WebView configuration points (viewport, scaling)
• Custom script injection
• Style customization
• File system integration points
• Size update callbacks
Implementation Details
• Required props
• Optional configurations
• Platform-specific behaviors
• Default values
• Supported file types
┌─────────────────────────────────────┐
• Consumer React Native App │
• ┬───────────────┘
• ↓
┌─────────────────────────────────────┐
• Auto Height WebView Component │
• ┤
• Custom Script Injection │
• Style Processing │
• Size Calculation │
• File Management │
• ┬───────────────┬────────┘
• ↓ ↓
┌───────────────────┐ ┌────────────────┐
• iOS WebView │ │ Android WebView │
• ┘ └────────────────┘
Important Considerations:
Interaction Patterns
• Bidirectional communication between WebView and native layers
• Size calculation flow
• Viewport handling differences between platforms
Configuration Points
• CustomScript injection
• Style application process
• File loading paths
• Platform-specific configurations
Special Attention Areas
• Scale handling differences between platforms
• Viewport content handling
• File system integration points
• Size update callback flow