S
S
savchenko912018-09-09 22:53:22
Node.js
savchenko91, 2018-09-09 22:53:22

How to change title in head in next.js?

I do this:
<Head>
<title>{this.state.country}</title>
</Head>
while on the page /country/montenegro go to /country/usa
i.e. it turns out this is the same page and only the slug changes and the component does not want to be re-rendered. how to force it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Epifanov, 2018-09-10
@kacheleff

If you are using redux, you can do this:

withRouter(connect(...)(MyComponent))
// or
compose(
  withRouter,
  connect(...)
)(MyComponent)

more here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question