Skip to content

Using router example improvements#1034

Merged
arunoda merged 1 commit intovercel:masterfrom
timneutkens:using-router-fix
Feb 9, 2017
Merged

Using router example improvements#1034
arunoda merged 1 commit intovercel:masterfrom
timneutkens:using-router-fix

Conversation

@timneutkens
Copy link
Copy Markdown
Member

This example wasn't functioning 😢

a: {
marginRight: 10
function onClickHandler (href) {
return (e) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would call this event

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The other examples use e too, that's why I'm using it here 👍

Copy link
Copy Markdown
Contributor

@albinekb albinekb Feb 8, 2017

Choose a reason for hiding this comment

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

Confusing! I think the examples should be as clear as possible?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

True, think we could update them later on.

)
export default class extends Component {
static getInitialProps () {
console.log(Router.pathname)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I believe it is intentionally broken to show what will happen when you use Router the wrong way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hehe ok 😂

</div>
)
export default class extends Component {
static getInitialProps () {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe remove this completely?

@arunoda
Copy link
Copy Markdown
Contributor

arunoda commented Feb 9, 2017

Okay. This looks nice to me.

@arunoda arunoda merged commit c106a1d into vercel:master Feb 9, 2017
@timneutkens timneutkens deleted the using-router-fix branch October 23, 2017 18:44
@lock
Copy link
Copy Markdown

lock bot commented May 10, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
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.

4 participants