工作我建立了幾個組件和現在正在測試他們,但我看到的是,反應PropTypes不拋出任何錯誤,我似乎無法找到原因。 例組件 import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Icon } from 'components';
class Test extends Co
我使用的終極版,但是當我運行我的代碼,我有這樣的錯誤: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. 我安裝 npm i prop-types -S 但II仍然有相同的錯誤。 ./components/action/article.
guys! 有沒有人得到 "Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead." 而使用React 15.5.3 "react-transition-group/CSSTransitionGroup"附加。 它看起來像這
一起使用TypeScript和React的正確方法是什麼,既然他們已經在15.5版的單獨項目中提取了PropTypes? 從15.4升級到15.5之後,一切都運行正常,除了現在我在控制檯中得到這個警告:"Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package
在一個陣營組成部分,如果我聲明: MyComponent.propTypes = {
// An object that could be one of many types
header: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
}
我怎麼知道,如果head