Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHL / HMR does not reload #5

Closed
pungggi opened this issue Feb 20, 2019 · 5 comments
Closed

RHL / HMR does not reload #5

pungggi opened this issue Feb 20, 2019 · 5 comments

Comments

@pungggi
Copy link

pungggi commented Feb 20, 2019

Hello, I am having trouble with the HMR. Changes to styles are not updated.
The cause is probably the same as gatsbyjs/gatsby#11032.

Could this be the default behaviour of the plugin?

@silvenon
Copy link
Collaborator

Thanks for reporting! Are you proposing that we turn HMR off for all .css files as part of this plugin? If that will solve the problem, I'm all for it.

@pungggi
Copy link
Author

pungggi commented Feb 22, 2019

sorry the problem for me has to do with this gatsby/issues/11934... your plugin is working fine!

@pungggi pungggi closed this as completed Feb 22, 2019
@pungggi
Copy link
Author

pungggi commented Feb 24, 2019

Hello first of all, great project!
I need to reopen after having more accurate findings:
I am not sure where to start explaining my issue maybe its here may be its react hot loader..
maybe its linaria.

I am using gatsby with react easy state.
gatsby 2.0.69 introduced a new version of react-hot -loader 4.6

As of this version Props passed to a styled` component are not hot updated if they are wrapped with view from react easy state..

For example:

Box.js

import { styled } from "linaria/react"

const Box = styled.div`
  color: ${(props) => (props.color ? props.color : "red")};

export default Box

then i consume

index.js

import { view } from 'react-easy-state'

export default view(() => {
  const classColor = css`
    color: green;
  `
  return (
     <Box padding={[30, 2, 10, 20]}>
       <div className={classColor}>
         <h1>About</h1>
       </div>
     </Box>
  )
})

If I change the classColor it updates.
But changing the value of the padding prop does not trigger a reload. This was working with gatsby 2.0.68 that uses react hot loader 4.5.

@pungggi pungggi reopened this Feb 24, 2019
@pungggi pungggi changed the title Disable HMR RHL / HMR does not reload Feb 24, 2019
@silvenon
Copy link
Collaborator

Thanks for providing more details, I'll leave this open even though I'm not sure if this is specific to my Linaria integration or something else. I have to be honest though that I don't know how to debug hot reloading, I was always using tools that already had it built-in.

@pungggi
Copy link
Author

pungggi commented Feb 24, 2019

hi thank you me either.. i stripped out linaria completely.. problem persits so I am closing here.

@pungggi pungggi closed this as completed Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants