React colspan not working

前端 未结 5 1897
梦谈多话
梦谈多话 2020-12-14 00:34

Why colspan attribute doesn\'t have effect in React? I created simple component which renders the following:


    <         
5条回答
  •  悲哀的现实
    2020-12-14 01:03

    From React's DOM Differences documentation:

    All DOM properties and attributes (including event handlers) should be camelCased to be consistent with standard JavaScript style.

    If you check your browser's console, you'll see that React warns you about this:

    
    
    
    
    
    

    Warning: Unknown DOM property colspan. Did you mean colSpan?
        in th (created by App)
        in tr (created by App)
        in tbody (created by App)
        in table (created by App)
        in App
    

提交回复
热议问题