# 暗黑模式判断

使用useDarkMode方法,返回布尔值,如果为true则表示暗黑模式已开启

# Class 组件用法

import { Component } from 'react';
import { injectTheme } from '@ezviz/rntheme'
 
class DeviceButton extends Component {
  constructor() {
    super();
  }
 
  render() {
    const darkMode = this.props.rntheme.useDarkMode();
    console.log(darkMode);  // true
 
    return null;
  }
}
 
export default injectTheme(DeviceButton);

# Function 组件用法

import { useDarkMode } from '@ezviz/rntheme'
 
export default props => {
  const darkMode = useDarkMode();
  console.log(darkMode);  // true
   
  return null
}