question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different appearances of components when using react-hot-loader

See original GitHub issue

As stated in https://github.com/carbon-design-system/carbon-components-react/blob/master/README.md: “1.These components require the use of Webpack in your project”

Typically, development webpack configurations use react-hot-loader while production webpack configurations don’t.

But carbon-components-react does not work with react-hot-loader, resulting in totally different appearances / behavior in development and production.

For example, in TableBody.js: if (child.type === TableRow)

This will work fine in production where there is no hotloading, but not in development when there is hotloading.

The reason: https://github.com/gaearon/react-hot-loader/issues/304

The fix is explained in the section on Checking Element types at https://github.com/gaearon/react-hot-loader/blob/master/README.md

This issue is similar to https://github.com/carbon-design-system/carbon-components-react/issues/857 but the difference is that it is not just the childrenOf and childrenOfType that are failing; components appear totally different.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asudohcommented, May 3, 2019

Some sources say that if (child.type === <TableRow>.type) (meaning, getting the type of an instantiated version instead of direct React component ref) solves this problem, but we don’t have a test case for this. That said, as @dakahn brought up, a test case is an important piece.

0reactions
carbon-botcommented, May 9, 2019

Hi there! 👋 If you’re wondering why this issue was moved, we’re currently updating our repo structure so that every package is found in the same project.

This should not have any impact for you, but we wanted to give you a heads up in case you were wondering what is going on. If you have any questions, feel free to reach out to us on Slack or contact us at: carbon@us.ibm.com. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started · React Hot Loader - Dan gaearon
React Hot Loader is a plugin that allows React components to be live reloaded without the loss of state. It works with Webpack...
Read more >
Set up React Hot Loader in 10 minutes
This is called hot reloading. It works by replacing a module of the application during runtime with an updated one so that it's...
Read more >
Hot Reloading in React. or, an Ode to Accidental Complexity
React Hot Loader was my first popular open source project and, to my knowledge, the first tool that allowed you to edit React...
Read more >
React-Hot-Loader 4.6
forwardRef would just work, memo will be updated on HMR(using our new super deep force update), and lazy would auto import updated module....
Read more >
Difference between Hot Reloading and Live ...
It reloads the whole app. Hot Reload isn't gonna cache everything, especially if you start messing around with the state. Live reload will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found