logdown.js icon indicating copy to clipboard operation
logdown.js copied to clipboard

React native support

Open tonyxiao opened this issue 6 years ago • 1 comments

Logdown doesn't seem to work in react native by default. This is my workaround

import 'localstorage-polyfill'
import { defaults } from 'lodash'
// https://github.com/caiogondim/logdown.js
localStorage.debug = __DEV__ ? '*' : false
// TODO: Make logdown recognize react-native properly
/**
 * Get color working in logdown
 * https://github.com/caiogondim/logdown.js/blob/master/src/util/is-color-supported/browser.js
 */
defaults(window, {
  document: {
    documentElement: {
      style: {
        WebkitAppearance: '',
      },
    },
  },
})

Would be great if it's officially supported.

tonyxiao avatar Mar 23 '18 22:03 tonyxiao

Thanks for the report. I'll work on it.

caiogondim avatar Mar 30 '18 17:03 caiogondim