Integration with Typescript (TSX)
See original GitHub issueI am trying to use pug in my Typescript React components like your basic example:
render() {
return pug`
div
h1 My Component
p This is my component using pug.
`;
}
The problem is that I can’t get it to work because the typescript loader fails on the pug command. However, to use babel, the Typescript files first have to be compiled to javascript. Can anyone help me get out of this Catch-22?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:20 (4 by maintainers)
Top Results From Across the Web
TypeScript: Documentation - JSX
JSX is an embeddable XML-like syntax. It is meant to be transformed into valid JavaScript, though the semantics of that transformation are ...
Read more >How to use TypeScript with React: A tutorial with examples
Using TypeScript with React can increase development speed, improve code readability, and much more. Learn how to get yourself going.
Read more >Getting Started with React and TypeScript
With React's focus on creating a fantastic user interface and TypeScript's ability to type check our code, it's never been easier to sanely ......
Read more >Using TypeScript with React
TypeScript is awesome. So is React. Let's use them both together! Using TypeScript allows us to get the benefits of IntelliSense, as well...
Read more >Getting Started With React and TypeScript Integration
Next, rename the files to become a TypeScript file (e.g. src/index.js to src/index.tsx ) and restart your development server!
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Never mind, it is working now.
I publish a library to solve this problem. webpack-preprocessor-pug-tsx