... It gives this error: " /> ... It gives this error: " /> ... It gives this error: "/>

NextJs and uikit framework: Prop className did not match

232 Views Asked by At

I'm using uikit framework in my next.js project.

In this HTML code:

<div className="uk-child-width-1-2@m" data-uk-grid>...</div>

It gives this error:

Warning: Prop `className` did not match.
Server: "uk-child-width-1-2@m uk-grid uk-grid-stack"
Client: "uk-child-width-1-2@m"

In fact, the data-uk-grid adds 2 classes (uk-grid and uk-grid-stack) to the element by its js. So there is a difference in the list of classes in Server and Client (due to server side rendering), and Nextjs gives this error.

Does anyone have a solution to this issue?

0

There are 0 best solutions below