react-redux-typescript-boilerplate | bare minimum frontend boilerplate with React | Frontend Framework library
kandi X-RAY | react-redux-typescript-boilerplate Summary
kandi X-RAY | react-redux-typescript-boilerplate Summary
A bare minimum frontend boilerplate with React 16, Typescript 3 and Webpack 4
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-redux-typescript-boilerplate
react-redux-typescript-boilerplate Key Features
react-redux-typescript-boilerplate Examples and Code Snippets
Community Discussions
Trending Discussions on react-redux-typescript-boilerplate
QUESTION
I've come across a pattern that can be summarized as:
...ANSWER
Answered 2020-Jun-27 at 01:06Your thinking is correct with regards to what the code is doing.
- Yes, the compiler infers whether it refers to the type alias or the namespace based on the usage.
For example: https://github.com/rokoroku/react-redux-typescript-boilerplate/blob/master/src/app/components/TodoList/index.tsx#L10
Here, TodoActions
is used as a type, so the compiler knows that it refers to the exported type alias.
Another example: https://github.com/rokoroku/react-redux-typescript-boilerplate/blob/master/src/app/reducers/todos.ts#L16
Here, TodoActions.Type.ADD_TODO
is used to create a property, so the compiler, again, knows that it refers to the namespace.
You can actually see this if you hover over the identifier in VS Code:
- and 3.) It can be a little confusing at first, but this is intended behavior. I personally would avoid it though, as it can cause unnecessary confusion.
The following article explains the exact question you have: https://www.typescriptlang.org/docs/handbook/declaration-files/deep-dive.html
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-redux-typescript-boilerplate
[x] Typescript Loader
[x] PostCSS Loader [x] PostCSS Preset Env [x] CSS modules
[x] React Hot Loader
[x] Mini CSS Extract Plugin
[x] HTML Webpack Plugin
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page