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

update antd-mobile to v2 #5419

Closed
wants to merge 3 commits into from
Closed

update antd-mobile to v2 #5419

wants to merge 3 commits into from

Conversation

Enalmada
Copy link
Contributor

@Enalmada Enalmada commented Oct 9, 2018

  • dependencies updated to latest versions
  • koubei icon gone, replaced with up
  • viewport method changed from hd to meta per migration guide
  • url changed to router withRouter() per next migration docs
  • this.state -> setState per console deprecation notice
  • Icon -> CustomIcon per antd-mobile 2x migration docs
  • tiny bit of formatting intelij must have done (hope that is ok)

Copy link
Contributor

@HaNdTriX HaNdTriX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently there is a client/server mismatch. See console:

Warning: Prop `aria-labelledby` did not match. Server: "m-tabs-3-0" Client: "m-tabs-0-0"

@Enalmada
Copy link
Contributor Author

Enalmada commented Oct 13, 2018

@HaNdTriX Thanks for taking a look! I noticed that client/server mismatch console error but sadly have no idea how to fix. (Closest hint I could find was this post). Since this example didn't run at all when I tried it, I didn't confirm if that is an existing issue in example code or due to antd version upgrade I did. I am hoping my changes to get this thing runnable on latest next will at least avoid complete new user frustration until someone more experienced than I can push a fix for that console error.

}
`,
}}/>

<link rel='stylesheet' type='text/css' href='//unpkg.com/antd-mobile/dist/antd-mobile.min.css' />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets also use the version from the package antd-mobile for that.

See https://github.com/zeit/next-plugins/tree/master/packages/next-css

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately when I try to load in css from antd-mobile I get this error:
image

It looks like there has been some bug in Next in the past about this?

Any ideas why just importing css causes that error?

@HaNdTriX
Copy link
Contributor

HaNdTriX commented Oct 13, 2018

@Enalmada by the way! Thanks for this great job! 🙏

@Enalmada
Copy link
Contributor Author

@HaNdTriX Could you try importing the css
Layout.js
import "antd-mobile/dist/antd-mobile.css"

next.config.js

const withCss = require("@zeit/next-css");
...
module.exports = withCss({ ... })

I seem to be hitting this: #1352 but I am unsure if this is a bug in Next.js or if users are required to put something in next.config.js to handle normalize.css?

@HaNdTriX
Copy link
Contributor

@Enalmada I tried it but it worked with my next.config.js.

const withCss = require('@zeit/next-css')
module.exports = withCss()

What next.js version are you using?

Currently I also don't have an idea whats causing the client/server mismatch. Maybe it`s an antd-mobile issue?

@Enalmada Enalmada deleted the with-antd-mobile branch November 2, 2018 19:55
@Enalmada
Copy link
Contributor Author

Enalmada commented Nov 2, 2018

@HaNdTriX I am using next 7.0.2. Looks like your example just got merged...thank you for your help getting antd-mobile example working on latest next!

@lock lock bot locked as resolved and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants