这里有什么问题?
'未捕获的TypeError:(0,_Game.observe)不是函数'
Game.jsx
export function observe(receive) {
setInterval(() => receive([
Math.floor(Math.random() * 8),
Math.floor(Math.random() * 8)
]), 500);
};
index.jsx
import React from 'react';
import ReactDOM from 'react-dom';
import Board from './Board';
import { observe } from './Game';
const rootEl = document.getElementById('root');
observe(knightPosition =>
ReactDOM.render(
<Board knightPosition={knightPosition} />,
rootEl
)
);