鍍金池/ 問答/HTML/ React.__spread is not a function

React.__spread is not a function

關(guān)于將父組件的所有props傳遞給子組件,在react15中可以用{...props}方式傳遞,但在react16中會報spread未定義,是有其他方式了嗎?

const Show=props=>(
        <div>{props.content}</div>
    );
    const App=props=>(
        <Show {...props} />
    );
    ReactDOM.render(<App content={'test'} />,document.body);
回答
編輯回答
挽歌

...ES6中的解構(gòu)運(yùn)算,與React的版本沒有關(guān)系。所以從其他地方入手解決。

2017年5月26日 10:51