Commit graph

15 commits

Author SHA1 Message Date
Tim Neutkens
ab42da0626
Run next/link codemod for Next.js 13 on examples (#41913) 2022-10-30 21:00:45 +01:00
Todor Totev
88fd6cf31d
[Examples] Removed React.FC/FunctionComponent from with-typescript (#13798)
Related to [this](https://github.com/facebook/create-react-app/pull/8177).

Let me know if you want me to change something.
2020-06-05 10:40:37 +00:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Shaswat Saxena
43c11904d3
Updated with-typescript example to SSG (#11081)
* Update with-typescript example to SSG

* Fixed usage of localhost inside SSG methods

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-03-18 15:15:04 -05:00
Resi Respati
42bf21091e [with-typescript] Updated TypeScript example to use API routes (#9073)
* [with-typescript] Updated TypeScript example to use API routes

Next.js 9.0.0 has been out for a while, which supports API routes, but
the examples were never updated to make use of it. This PR adds a simple
example of an API route which also makes use of dynamic routing.

A simple `fetch()` wrapper is also added for example purposes, and the
pages structure have also been updated to dynamic routing.

* Properly link to the dynamic page
2019-10-16 13:38:14 -05:00
Joe Haddad
b3170d2648
Format missed files (#7464)
* Format missed files

* Remove unnecessary rule

* Fix type error
2019-05-29 18:19:32 -07:00
Resi Respati
a275ad0922 Updated typescript examples (#7337)
* Updated with-typescript example
2019-05-15 21:04:08 -05:00
Lukáš Huvar
d7152f6ae4 Update typescript example to reflects out of box usage (#7235) 2019-05-14 13:31:46 -05:00
Resi Respati
f8a80f1aa9 [with-typescript] remove unnecessary passHref in Link components (#6233)
As per discussion in #6165, I removed the `passHref` in `Link` as
they're unnecessary.
2019-02-11 00:00:05 +01:00
Resi Respati
8fdb133903 [with-typescript] Improved intial props examples, added example detail (#6165)
I've just thought of a way to improve the initial props page by adding
an example for a list/detail page structure. To do that, I've created a
separate `/detail` page, and a mock API which calls data from the array
we made on the previous PR.

A ListDetail component is created as an example for displaying detail.

Page structure is also cleaned up. Should I go ahead and add an example
on how to style with styled-jsx + its TS declarations? I might decide to
do it within this week anyway.
2019-01-31 17:36:02 +00:00
Justin Noel
d6ec10a4bf add new nextjs typings with samples (#6102)
The current `examples/with-typescript` is not using the latest type definitions currently available on DefinitelyTyped project for next.

Added new list page examples that demonstrate how to use the new Types for both stateless functional components and classes.  Also modified examples for list to demonstrate typings for `getInitialProps`.
2019-01-23 12:37:09 +01:00
Peter Kellner
3a3347dc5f The current TypeScript "with-typescript" looks like it was put there as a place holder. I'm fairly new to TypeScript but I'm sure the changes I've made here will be a huge improvement. Open to suggestions and to update as appropriate. Also, Tried to run yarn lint --fix to no avail. I can't figure out how to get it to find lint whether I'm running on my mac or PC. I tried lots of variations around npm i lint -g but had no success. (#6011) 2019-01-08 22:29:58 +01:00
Resi Respati
397daece42 with-typescript example updates (#5267)
* [with-typescript] Updated `@zeit/next-typescript` and typescript typings

* [with-typescript] Updated tsconfig to match new recommended config

* [with-typescript] upgraded dependencies, implement type-checking

* [with-typescript] add _document example, fixed tsconfig

* [with-typescript] updated README

* [with-typescript] updated example contents

* [with-typescript] adopt the Layout component from Flow example
2018-09-26 09:58:36 +02:00
Brice BERNARD
45e26f22b3 Fix tsx workaround, bootstrap next.d.ts, add tslint deps (#2885) 2017-11-13 13:59:00 +01:00
Giacomo Rebonato
b00f0c2044 TypeScript example proposal (#845)
* TypeScript example proposal

* removed unused loader

Removed typings

Moved TypeScript to dev dependencies

removed unused typings

changed react typings version

removed react dependency

set next dependency version to latest

removed not needed babel preset

enabled sourcemaps

simplified tsconfig

modified component to be a functional one

* Ignore build

* Making npm script Windows-friendly

* Clean up

* Added readme

* fixed typo
2017-02-09 12:36:58 +01:00