React框架开发问题总结

react-dom.js:18962 Warning: Unknown prop `col` on  tag. Remove this prop from the element. For details, see  https://fb.me/react-unknown-prop
    in td (created by ListComponent)
    in tr (created by ListComponent)
    in table (created by ListComponent)
    in div (created by ListComponent)
    in ListComponent
    in div

解决办法:把col改成colSpan
/td>

react-dom.js:18962 Warning: validateDOMNesting(...):  cannot appear as a child of . See ListComponent > table > tr. Add a  to your code to match the DOM tree generated by the browser.
解决办法:
加增加子元素

react-dom.js:18698 Uncaught Invariant Violation: Expected onClick listener to be a function, instead got type string
解决办法: 预计OnClick侦听是一个函数,而不是字符串类型了
首页
改成
首页


react.js:3801 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListComponent`. See  https://fb.me/react-warning-keys for more information.
    in tr (created by ListComponent)
    in ListComponent
    in div

解决办法:在循环array或iterator时,要给循环的标签增加一个key值。
[0,1].map((child, i) => {
                    return (
                      
                        

                      
                    );
                  })

react-dom.js:18698 Uncaught Invariant Violation: noData.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
翻译: return里面的元素不完整 可能返回了undefined或数组或其他非法对象
 render: function() {
        let text;
        if (this.props.isShow) {
          text = ({this.props.text}
);
        }
        console.log(text);
        return ({text});
      }
解决办法:返回值应该包裹在一个元素内
return (
{text}
);
 

react-dom.js:18109 Warning: Unknown DOM property readonly. Did you mean readOnly?
警告:未知的DOM属性只读的。 你的意思是只读的
    in input (created by App)
    in li (created by App)
    in ul (created by App)
    in div (created by App)
    in App (created by App)
    in App

readonly改成 readOnly
HTML 属性

这些标准的属性是被支持的:

accept acceptCharset accessKey action allowFullScreen allowTransparency alt
async autoComplete autoPlay cellPadding cellSpacing charSet checked classID
className cols colSpan content contentEditable contextMenu controls coords
crossOrigin data dateTime defer dir disabled download draggable encType form
formAction formEncType formMethod formNoValidate formTarget frameBorder height
hidden href hrefLang htmlFor httpEquiv icon id label lang list loop manifest
marginHeight marginWidth max maxLength media mediaGroup method min multiple
muted name noValidate open pattern placeholder poster preload radioGroup
readOnly rel required role rows rowSpan sandbox scope scrolling seamless
selected shape size sizes span spellCheck src srcDoc srcSet start step style
tabIndex target title type useMap value width wmode


react-dom. js:18109 Warning: Failed form propType: You provided a `value` prop to a form field without an `onChange` handler.  This will render a read-only field.  If the field should be mutable use `defaultValue`.  Otherwise, set either `onChange` or `readOnly`.  Check the render method of `App`.

input 的value属性要改成 defaultValue

你可能感兴趣的:(reactnative)

item.time