question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for React/Typescript React

See original GitHub issue
"inlineFold.supportedLanguages": [
  "html",
  "svelte",
  "react",
  "javascript react",
  "typescript react",
  "javascript",
  "js",
  "tsx",
  "jsx",
  "ts"
],,
"inlineFold.regex": "className=\".+?(?=\")",

These are settings I’ve tried to achieve className folding in .tsx files.

I’m not sure it is not supported yet or I haven’t do it right.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
moalamricommented, Jul 3, 2022

Worked perfectly! I wished to find information like this in the docs even nicer if it comes with regex settings.

Good to hear that 😃 Sure I’ll update the docs with some common regex examples also more descriptive settings.

One more question before this will be closed, how can i use regex to select ` (backtick) or { (open curly bracket) after className CleanShot 2022-07-04 at 04 08 52

That’s why I asked for the code because the regex I gave worked only for double quotes className. Try this https://regex101.com/r/RkCWEk/1 and if you mean { and ` could come together? I’m not really familiar with reactjs, but if so then I guess it’s also achievable https://regex101.com/r/NuDLoF/1 Both use the default group number: 2

2reactions
moalamricommented, Jul 3, 2022

Add typescriptreact to the languages list.

The extension uses languageId as because a language could have more than one file extension & aliases

Here’s a list of known languages Known language identifiers

Read more comments on GitHub >

github_iconTop Results From Across the Web

React - TypeScript: Documentation
TypeScript supports JSX and can correctly model the patterns used in React codebases like useState . Getting Set Up With a React Project....
Read more >
How to use TypeScript with React: A tutorial with examples
Support for existing React projects ... TypeScript allows you gradually adapt its usage in your existing projects. You can also configure the ...
Read more >
Static Type Checking - React
Create React App supports TypeScript out of the box. To create a new project with TypeScript support, run: npx create-react-app my-app --template typescript....
Read more >
Adding TypeScript - Create React App
Global installs of create-react-app are no longer supported. To add TypeScript to an existing Create React App project, first install it:.
Read more >
Using TypeScript with React - DigitalOcean
This tutorial covers how to use TypeScript with React functional or class-based components. In this post we also make use of the Parcel ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found