title: React Native: can't find variable document
body: <p>I am trying to add EventListner to document object but getting error as <code>cant find variable document</code> .
  Below is my code</p>
  
  <pre><code>import * as React from 'react';
  import { Easing, Text, View, StyleSheet , Button , TextInput , TouchableOpacity , TouchableWithoutFeedback, Animated} from 'react-native';
  import DateTimePicker from "react-native-modal-datetime-picker";
  import { Platform, StatusBar} from 'react-native';
  import ReactDOM from 'react-dom';
  // You can import from local files
  
  // or any pure javascript modules available in npm
  
  export default class App extends React.Component {
  
    state = {
      menuwidth: new  Animated.Value(0)
    }
  
    showmenu = () =&gt; {
      Animated.timing(this.state.menuwidth,{
        toValue: 1,
        duration: 550,
        easing: Easing.linear
      }).start();
    }
  
    hidemenu = () =&gt; {
  
    }
  
  
    componentWillMount() {
      document.addEventListner('click',this.clickoutside,false)
    }
  
    componentWillUnMount(){
      document.removeEventListner('click',this.clickoutside,false)
    }
  
    render() {
  
      const menuwidth_interpole = this.state.menuwidth.interpolate({
        inputRange: [0,1],
        outputRange: ['-50%','0%']
      })
  </code></pre>
  
  <p>am i missing something ? . i am using this tutorial <a href="https://medium.com/@pitipatdop/little-neat-trick-to-capture-click-outside-with-react-hook-ba77c37c7e82" rel="nofollow noreferrer">https://medium.com/@pitipatdop/little-neat-trick-to-capture-click-outside-with-react-hook-ba77c37c7e82</a> to resolve click outside component issue.</p>