• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

222
Views
"ES7 React/Redux/GraphQL/React-Native snippets" is not working for javascript file. Do I need to configure something else than just installing it?

I was editing a javascript file, and when I wrote: p{Hello} I expected it to convert into <p>Hello</p> .But it doesn't seem to happen. Is there anything else I need to do to configure this extension in VS Code to make it work? The code is given below.

import React, { Component } from "react";

const ArrowHeader = () => {
  return(
    p{Hello}
  )
}
class App extends Component {
  render() {
    return (
      <div className="App">
        <h1>Hello Scaler</h1>
      </div>
    );
  }
}

export default App;

almost 3 years ago · Santiago Gelvez
3 answers
Answer question

0

p{Hello} is not a component. if you want to display <p>Hello</p>, you need to create a custom component.

almost 3 years ago · Santiago Gelvez Report

0

Actually, the problem is not with the ES7 extension, but emmet was not configured with javascript files, it works fine after adding javascript as a language for emmet.

almost 3 years ago · Santiago Gelvez Report

0

-Try adding this to your settings.json file:

"emmet.includeLanguages": {
        "javascript": "javascriptreact"
    }

-If you don't want that configuration, you can manually change it to each file Language Mode to JavaScript React:

  1. With the .js file open click on the Language Mode Selector: Language Mode Selector

  2. Search for JavaScript React (or JSX): Select JavaScript React

  3. Check if it applied correctly: JSX Mode applied

almost 3 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error