Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript example #102

Closed
andria-dev opened this issue May 9, 2020 · 6 comments · Fixed by #267
Closed

TypeScript example #102

andria-dev opened this issue May 9, 2020 · 6 comments · Fixed by #267
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andria-dev
Copy link
Collaborator

In need of an example of using this package built with TypeScript to be able to ensure that future versions stay TypeScript compatible.

Preferably to be hosted in this monorepo, however, could also be a link to CodeSandbox or Glitch.

@andria-dev andria-dev added documentation Improvements or additions to documentation help wanted Extra attention is needed good first issue Good for newcomers labels May 9, 2020
@horacioh
Copy link
Contributor

horacioh commented Jun 1, 2020

What type of examples do you think could be useful?

@andria-dev
Copy link
Collaborator Author

I think a simple one of this project in client-side mode would be useful. Basically just any kind of small example utilizing this hook in TypeScript would be useful (kind of using this as a way to ensure that this project's .d.ts file works correctly with TypeScript).

@thorsten-stripe
Copy link
Collaborator

fyi, I'm currently working on adding a TypeScript shopping cart implementation here: https://github.com/vercel/next.js/tree/canary/examples/with-stripe-typescript

@thorsten-stripe thorsten-stripe self-assigned this Jun 12, 2020
@thorsten-stripe
Copy link
Collaborator

thorsten-stripe commented Jun 12, 2020

I’m working on it here: https://github.com/thorsten-stripe/next.js/tree/thor/stripe/add-use-shopping-cart-example/examples/with-stripe-typescript
Found an issue that I’ll try to investigate tmr: #122

And some type fixes here: #123

@thorsten-stripe
Copy link
Collaborator

This has been shipped: https://github.com/vercel/next.js/tree/canary/examples/with-stripe-typescript

Should we include it in the docs/README somewhere?

@osnodegeoffrey
Copy link
Contributor

osnodegeoffrey commented Aug 11, 2021

It seems that there were some movements in 3.0.0

import { CartProvider } from 'use-shopping-cart'

does not work as it seems to be under use-shopping-cart/react but it is complaining about /react not exported if I switch.

Any suggestions?

EDIT: To clarify, it does work with the code above but there is some typescript complaint about missing types (TS7016)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants