React .tsx typescript files not working #1633

Closed
opened 2025-08-09 17:21:02 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @Strandedpirate on 5/5/2016

I setup a small app to test NodeServices with React.js, webpack and Typescript but it does not render the Hello component to screen. No client-side errors, the webpack bundle is getting included, but NodeServices isn't sending down the pre-rendered html to the page with Typescript added to the equation.

Is there something special I need to do to get it to render with Typescript in the mix?

hello.tsx

import React = require("react");

export default class Hello extends React.Component<any, any> {

    render() {
        return <div>Hello world!</div>;
    }
}

index.cshtml

<div id="react-app" asp-prerender-module="ReactApp/UI/Views/hello.tsx"
     asp-prerender-webpack-config="webpack.config.js"></div>

@section scripts {
    <script src="/scripts/app.bundle.js"></script>
}

<h2>Home page!</h2>
*Originally created by @Strandedpirate on 5/5/2016* I setup a small app to test NodeServices with React.js, webpack and Typescript but it does not render the _Hello_ component to screen. No client-side errors, the webpack bundle is getting included, but NodeServices isn't sending down the pre-rendered html to the page with Typescript added to the equation. Is there something special I need to do to get it to render with Typescript in the mix? **hello.tsx** ``` import React = require("react"); export default class Hello extends React.Component<any, any> { render() { return <div>Hello world!</div>; } } ``` **index.cshtml** ``` <div id="react-app" asp-prerender-module="ReactApp/UI/Views/hello.tsx" asp-prerender-webpack-config="webpack.config.js"></div> @section scripts { <script src="/scripts/app.bundle.js"></script> } <h2>Home page!</h2> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1633
No description provided.