Giter Site home page Giter Site logo

Comments (7)

HeyProtagonist avatar HeyProtagonist commented on August 12, 2024

Can you publish the project in github and send link? or Mention the project structure.

from react-typescript-webpack-starter.

kentmz avatar kentmz commented on August 12, 2024

Please check out the repo at https://github.com/kentmz/react-setup
Also, some of the issues I faced was:

  1. When you navigate to a route and refresh the route, it gives an error saying "Cannot GET /dashboard". I fixed this my adding output.publicPath = '/' and devServer.historyApiFallback = true in webpack.

from react-typescript-webpack-starter.

HeyProtagonist avatar HeyProtagonist commented on August 12, 2024

Hi Kent,

  1. For the 1st Thread:

    • You should always add config files in the root. That's the standared almost all libraries follow.
    • declarations file works fine some times. According the editors memory management. It could be trouble some. But you can
      either restart TextEditor or only the Typescript server. [ ctrl + shift + p , restart typescript server ]. This would restart the lints
      for default VsCode TS
  2. For the recent Thread:

    • For routing. I think you should pass the routable component as prop other than child. But If there's way. You should bend
      your perspective little bit. But I'd recommend for your code. It's fine to pass the dashboard component to the Route
      Component as a prop.

for referance try these: Sample Router File

Please always pull from "vishwas" repo. Coz, he's constantly updating the setup.

from react-typescript-webpack-starter.

kentmz avatar kentmz commented on August 12, 2024

Hi,

Thanks for getting back on this. Appreciate it. I tried to move the tsconfig.json to the root. But now all my imports are giving error, example "Could not find a declaration file for module 'react-router-dom'. "
Appreciate your help on this.
Thanks.

from react-typescript-webpack-starter.

HeyProtagonist avatar HeyProtagonist commented on August 12, 2024

Yeah you missed some TypeScript packages.
Eg: @types/react-router-dom, also try comment react-cookies. Since you only declared.

from react-typescript-webpack-starter.

kentmz avatar kentmz commented on August 12, 2024

Thanks a lot. This resolved the issue.

from react-typescript-webpack-starter.

HeyProtagonist avatar HeyProtagonist commented on August 12, 2024

Hi Kent,

If the Issue got rectified. Please close.

from react-typescript-webpack-starter.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.