ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.25k stars 429 forks source link

Dimensions.addEventListener does not function #187

Closed jtag05 closed 6 years ago

jtag05 commented 6 years ago

Description

Dimensions.addEventListener method does not fire on window resize.

Reproduction Steps and Sample Code

import { Dimensions } from 'react-native';

const handler = (dims) => {
    console.log(dims); // Never called
}

Dimensions.addEventListener('change', handler);

Solution

I have yet to dive into what might be causing this issue but I'll begin to debug.

Additional Information

shirakaba commented 6 years ago

I've found that the Dimensions.get("window") just returns the full screen size rather than the size of the window. Probably related..!

ptmt commented 6 years ago

@shirakaba you were right! Sorry took me so long. Finally got time to fix minor issues.

ptmt commented 6 years ago

aug-06-2018 21-06-54