Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

83
Views
cannot render any of my code to my react-appliaction

I am making a Typescript and React app. I am using 4 main files, App.tsx, Header.tsx, Ap.css. I think the real problem is the way I am trying to use the add the Header.tsx file to App.tsx.

Please help

App.tsx:

import React from "react";
import Header from "./Header";
import "./App.css";

function App() {
  return (
    <div className="App">
      <Header />
    </div>
  );
}

export default App;

Header.tsx:

import React from "react";
import "./Header.css";

function Header() {
  return (
    <div className="nav-container">
      <nav>
        <a href="#!">Home</a>
        <a href="#!">About</a>
        <a href="#!">Projects</a>
        <a href="#!">Resume</a>
      </nav>
    </div>
  );
}
export default Header;

App.css:

.App {
  text-align: center;
  color: white;
}

body {
  background-color: #171A25;
  color: #ffffff;
}

Header.css:

body {
    margin: 0px;
    background-color: #121625;
}
.nav-container {
    text-align: center;
    font-size: 24px;
    color: white;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It looks like there is nothing wrong with your import method. I think you should check your webpack.config.js file. In resolve part should contain ts and tsx types.

resolve: {
        extensions: ['.tsx', '.ts', '.js'],
    },

and also you have to add tsconfig.json file to your project. https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

https://webpack.js.org/guides/typescript/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!