GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - purescript-react/purescript-nextjs

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSES
LICENSES
 
 
src/Next
src/Next
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
spago.yaml
spago.yaml
 
 

Repository files navigation

purescript-nextjs

Purescript FFI bindings to Next.js.

In order to bootstrap a Next.js project with Purescript you can use our purescript-nextjs-template. You can find the information on how to get started in that repo.

Usage

Once you have set up a Next.js project, you can use the FFI bindings here. This library provides bindings for many of the features described in the Next.js documentation. We don't have FFI for everything yet, if you are missing something feel free to create an issue or even better: create a PR!

Router

Here is an example how to use the router.

import React.Basic.DOM.Simplified.Generated as R
import React.Basic.Hooks as React
import Next.Router as NextRouter

...

React.component "MyComponent" \props -> React.do
    router <- NextRouter.useRouter
    let
        q :: { myQueryParam :: String }
        q = query router

        dispatchRoute = Router.push Router
    pure $ R.button { onClick: handler_ $ dispatchRoute "/about" } "Click me"

Credits

This lib has been heavily inspired by and initially extracted from next-purescript-example, which is licensed under MIT.

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity
Custom properties

Stars

11 stars

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.