reactable icon indicating copy to clipboard operation
reactable copied to clipboard

Table Rows do not render when using modern React stack

Open porteron opened this issue 6 years ago • 18 comments

Our project recently upgraded to the most recent version of the React-boilerplate repo. Once we upgraded all the <Tr>s in the tables would no longer render. It only breaks once the project is built, it works in local dev mode. Might be a babel/webpack issue.

Not sure where the incompatibility lies. I saw that reactable is still dependent on react v 0.14.1 which is very very very old.

Probably needs to upgrade at least the react package along with some other things.

We are migrating now to another table package in the meantime.

porteron avatar Aug 09 '18 03:08 porteron

Hi, I have the same problem with [email protected] on dev mode only. I update to 1.1.0 to making this work

JiDai avatar Aug 30 '18 07:08 JiDai

Oops I am sorry, I have not the same problem. The Tr did not not render at all

JiDai avatar Aug 31 '18 12:08 JiDai

I can confirm this issue, sorry about that, I'm working on a fix. In the meanwhile, try 1.0.2

abdulrahman-khankan avatar Sep 05 '18 08:09 abdulrahman-khankan

My team project uses this and the behavior we see now is 1.0.2 works for production but not development 1.1.0 works for development not production.

Thank you for working on the fix.

kristw avatar Sep 19 '18 22:09 kristw

Experiencing the same behavior as @kristw - 1.0.2 doesn't work on dev builds, 1.1.0 doesn't work on prod builds

dpgalloway avatar Nov 02 '18 19:11 dpgalloway

Locking to version 1.0.2 worked for me (for production)

simondiep avatar Nov 05 '18 20:11 simondiep

Same here, seems related to minifying and this commit: https://github.com/abdulrahman-khankan/reactable/commit/e4eebcb9c2739e8375d68937376c715100993bf5

The commit above changes the way Table detects the type of its children to use strings. Minifying the code changes the classnames, meaning the strings Td etc. will not work as intended.

larsmoil avatar Nov 14 '18 20:11 larsmoil

Experiencing the same issue on 1.1.0. Is someone currently working on a fix? I'm able to run it nicely on 1.0.2 in dev as well as in prod mode.

I'm using a CRA 2.0 boilerplate with react 16.7.0-alpha.2.

MustansirZia avatar Nov 30 '18 09:11 MustansirZia

I workaround by excluded it from webpack uglify mangle

zjye avatar Jan 09 '19 01:01 zjye

@zjye Can you show how you workaround it by webpack uglify managle?

lciolecki avatar May 28 '19 10:05 lciolecki

@zjye Can you show how you workaround it by webpack uglify managle? UglifyJsPlugin

  optimization: {
    minimizer: new UglifyJsPlugin({
      uglifyOptions: {
        mangle: {
          reserved: ['Td', 'Tr', 'Th', 'Thead'],
        },
      },
    })],
  },

TerserPlugin

 optimization: {
    minimizer: [new TerserPlugin({
      terserOptions: {
        mangle: {
          reserved: ['Td', 'Tr', 'Th', 'Thead'],
        },
      },
    })],
  },

zjye avatar May 28 '19 12:05 zjye

Thanks man! You made my day! :)

lciolecki avatar May 28 '19 13:05 lciolecki

Does anyone know how to fix this?

spoeken avatar Jan 23 '20 11:01 spoeken

thead is not rendering at all here showing the header name as blank

kalimuthu123 avatar Mar 04 '20 10:03 kalimuthu123

Hit the same issue on 1.1.0

Downgrading to 1.0.2 was enough to fix it in development and production builds for me without the UglifyJS changes.

CodyReichert avatar Apr 13 '20 15:04 CodyReichert

I have tried the below configuration with webpack version 5.25.0 and it's worked for me.

optimization: {
  minimizer: [(compiler) => {
    return () => {
     return {
      terserOptions: {
        mangle: {
          reserved: ['Td', 'Tr', 'Th', 'Thead']
        }
      }
     }
    }
  }]
 }

NikunjPansuriya avatar Mar 17 '21 13:03 NikunjPansuriya

thanks @NikunjPansuriya, your solution helped me make reactable work with react 17

alexkhismatulin avatar Apr 22 '21 11:04 alexkhismatulin

I have tried the below configuration with webpack version 5.25.0, and it's worked for me.

optimization: {
  minimizer: [(compiler) => {
    return () => {
     return {
      terserOptions: {
        mangle: {
          reserved: ['Td', 'Tr', 'Th', 'Thead']
        }
      }
     }
    }
  }]
 }

It worked when I needed to migrate my React project from 15.6.2 to 16.14.0 and Webpack from 3.8.1 to 5.75.0.

arthurmenezesb avatar Jul 04 '23 13:07 arthurmenezesb