0

当我启动 Reactotron 时,有几个日志,然后是白屏。我认为这不应该是代码的问题,因为我团队中的其他工程师没有问题。为 React-native、Redux 和 Saga 安装了最新版本的 Reactotron 和软件包。有没有人有类似的问题?

包.json

    "reactotron-react-native": "^5.0.0",
    "reactotron-redux": "^3.1.3",
    "reactotron-redux-saga": "^4.2.3",
import Reactotron from 'reactotron-react-native'
import { reactotronRedux } from 'reactotron-redux'
import sagaPlugin from 'reactotron-redux-saga'
import AsyncStorage from '@react-native-async-storage/async-storage'

const exceptActions = ['session/addPeak']

const reactotron = Reactotron.configure({
  name: 'React Native',
})
  .useReactNative({
    asyncStorage: true, // there are more options to the async storage.
    networking: {},
    editor: false, // there are more options to editor
    errors: { veto: (stackFrame) => false }, // or turn it off with false
  })
  .setAsyncStorageHandler(AsyncStorage)
  .use(reactotronRedux({ except: exceptActions }))
  .use(sagaPlugin({ except: exceptActions }))
  .use(reactotronRedux())
  .connect()

// swizzle the old one
const yeOldeConsoleLog = console.log

// make a new one
console.log = (...args) => {
  // always call the old one, because React Native does magic swizzling too
  yeOldeConsoleLog(...args)

  // send this off to Reactotron.
  Reactotron.display({
    name: 'CONSOLE.LOG',
    value: args,
    preview: args
      ? args.length > 0 && typeof args[0] === 'string'
        ? args[0]
        : args
      : null,
  })
}

export default reactotron

传奇中间件

import Reactotron from '../reactotron'

const sagaMonitor = Reactotron.createSagaMonitor()

const sagaMiddleware = createSagaMiddleware({ sagaMonitor })

export default sagaMiddleware
4

0 回答 0