react-native-windows-samples
react-native-windows-samples copied to clipboard
Possible bug in example code
In this snippet
https://github.com/microsoft/react-native-windows-samples/blob/fd8310144083733eec02d1dde18032aea02f6faa/docs/windowsbrush-and-theme.md?plain=1#L53-L59
is it correct to call addChangeListener in response to componentDidMount and componentWillUnmount?
Yep, that's wrong. Should be a removeChangeListener. Whoops!
I'm just learning so apologies, but in the 'not-Windows' React Native there is no removeChangeListener
https://reactnative.dev/docs/appearance
and in the Windows codebase there is addListener and removeListeners with an 's'.
https://github.com/microsoft/react-native-windows/blob/b051774f5429ed49df69e0b85ae16cfae8c18922/vnext/codegen/NativeAppearanceSpec.g.h#L17
Is that relevant?