NextWeb.js

NextWeb.js

  • Docs
  • GitHub

›Page

Getting Started

  • Getting Started
  • Folder Structure
  • Create a New Page
  • Navigate Between Pages

App

  • Environment Variables
  • Module Alias
  • Routing
  • Context
  • Store
  • Authentication

Page

  • Layout
  • Meta
  • Breadcrumb
  • Stats
  • Restricted Pages

Data Fetching

  • Repositories & Services
  • Server-Side Fetching
  • Client-Side Fetching
  • Error Handling
  • Custom Error

Styling

  • Local Styles
  • Global Styles
  • Grids
  • Style Helpers
  • Fonts
  • Icons

Deployment

  • Deployment

Restricted Pages

If a page has some private information about the logged in user, you may have to restrict access to this page. Just set the restricted option for withPage() to true.

// src/components/account/index.js

import React from 'react'
import withPage from '@lib/page/withPage'

function AccountPage() {
  return <div>Some secret stuffs</div>
}

export default withPage({ restricted: true })(AccountPage)

Now this page is available only for logged in users while the others will be redirected to the home page.

← StatsRepositories & Services →