How do I set fallback: false for this dynamic route set up #14803
Unanswered
TomDowling
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have set up a dynamic route, think it might be a bit of a bad build. However, I really don't want to start over to get the fallback to work. This issue is when I don't have a route it just goes to a white screen and not redirecting to the 404 page, all the code for dynamic route is on this one page, and is located at pages / portfolio / [id] / index.js.
`
import { withRouter } from "next/router";
import Router from 'next/router';
import Link from "next/link";
import Prismic from "prismic-javascript";
import "./../../../Styles/styles.less";
import Head from "./../../../Components/Layout/Markup/Head";
import Header from "./../../../Components/Layout/Header/Header";
import Footer from "./../../../Components/Layout/Footer/Footer";
class Portfolio extends React.Component {
constructor(props) {
super(props);
this.state = {
apiEndpoint: "***",
loading: true,
slug: this.props.router.query.id,
uid: "",
data: [],
};
}
}
export default withRouter(Portfolio);
`
Beta Was this translation helpful? Give feedback.
All reactions