Skip to content

Usage example? #3

@7yl4r

Description

@7yl4r

I can't get this to import into an example react app from following the advice in the template's README.
Maybe it is out of date?
Can someone check my methods below or provide alternative guidance?

Steps to reproduce:

 npx create-react-app react-vocab-suggester-test-app --template typescript
 cd react-vocab-suggester-test-app/
 npm install git+ssh://git@github.com/7yl4r/react_component
 sed -i '1iimport { Button } from "@7yl4r/vocab_suggester";\n' src/App.tsx 
 npm run start

This will yield the following error:

Compiled with problems:
ERROR in src/App.tsx:1:24
TS2307: Cannot find module '@7yl4r/vocab_suggester' or its corresponding type declarations.
  > 1 | import { Button } from "@7yl4r/vocab_suggester";
      |                        ^^^^^^^^^^^^^^^^^^^^^^^^
    2 |
    3 | import React from 'react';
    4 | import logo from './logo.svg';

I can confirm that @7yl4r/vocab_suggester has been added to the package.json.
I tried clearing the cache as suggested by ChatGPT and did this twice to be sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions