-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Closed
Description
When loading page, the follow displays within the error console. This was after switching to next/link
over the older next/prefetch
Upon clicking a link, the following error is generated in the console.
Upon generating these errors, navigation does not continue to the next page, and instead shows the current page and destroys all existing styles.
Example Code -
import React, { PropTypes } from 'react';
import Link from 'next/link';
import SVG from './SVG';
function Logo({ href, title, id, width, height }) {
const linkProps = { title };
return (
<span className="logo">
<Link prefetch href={href} >
<a {...linkProps} >
<SVG id={id} width={width} height={height} />
</a>
</Link>
<style jsx>{`
.logo {
color: #F0F;
}
`}</style>
</span>
);
}
Logo.defaultProps = {
width: 'auto',
height: 'auto',
};
Logo.propTypes = {
href: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
width: PropTypes.string,
height: PropTypes.string,
};
export default Logo;
Metadata
Metadata
Assignees
Labels
No labels