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

react hot loader 4.6 broken #77

Closed
pungggi opened this issue Feb 24, 2019 · 12 comments
Closed

react hot loader 4.6 broken #77

pungggi opened this issue Feb 24, 2019 · 12 comments

Comments

@pungggi
Copy link

pungggi commented Feb 24, 2019

Hello first of all, great project!
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

Then I use a css in js solution called linaria.

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.

@solkimicreb
Copy link
Member

Which version of react-easy-state are you using? v6.1.x migrated to React hooks when possible under the hood. Maybe the issue has to do something with that.

@pungggi
Copy link
Author

pungggi commented Feb 24, 2019

I does not matter if 6.1.1 or 6.0.6 both behave the same in this case

@pungggi
Copy link
Author

pungggi commented Feb 24, 2019

I setup a repo for reproduction

https://github.com/pungggi/rhl

see Branch hotload4_6 this uses the latest packages with react hot loader ^4.6.0

@solkimicreb
Copy link
Member

solkimicreb commented Feb 25, 2019 via email

@pungggi
Copy link
Author

pungggi commented Feb 26, 2019

opened an issue in react hot loader too.

@pungggi pungggi closed this as completed Mar 2, 2019
@solkimicreb
Copy link
Member

@pungggi Did you manage to solve this?

@buzinas
Copy link
Contributor

buzinas commented Mar 15, 2019

@pungggi why was this issue closed? How can I make react-hot-loader work with react-easy-state?

@pungggi pungggi reopened this Mar 15, 2019
@n3v3rd1e
Copy link

Hello, did anyone managed to solve this, or is it still not working?

@n3v3rd1e
Copy link

I do not mean to spam, but I feel like this is a really important issue and should not be ignored as it makes easy-state kinda not usable right now. Some statement about this would be highly appreciated, thank you.

@solkimicreb
Copy link
Member

Looking into this. It seems to be an issue with functional components only. Did anyone have issues with class components and HMR?

@solkimicreb
Copy link
Member

I just released v6.1.3 which hopefully fixes this issue 🎉 Please reopen it if the issue stays for any of you. Sorry for the long wait!

@n3v3rd1e
Copy link

Nice work perfectly, thanks 👍

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

4 participants