Javascript React props intellisense与ASP.NET内核

Javascript React props intellisense与ASP.NET内核,javascript,reactjs,asp.net-core,react-props,react-proptypes,Javascript,Reactjs,Asp.net Core,React Props,React Proptypes,我正在尝试为React道具获取intellisense。之前,我会将ViewModel传递给Razor视图(.cshtml)@model namespace.WeatherVM。然后我就可以很容易地访问所有可用的属性,比如@Model.TemperatureF。Intellisense将弹出并让我知道可访问的内容 作为回应,我也想做同样的事情。在我的虚拟机中,如果我有40个属性,我需要一个intellisense或一些可以显示所有可用属性的东西 假设我有这样的东西: function rende

我正在尝试为React道具获取intellisense。之前,我会将ViewModel传递给Razor视图(.cshtml)<代码>@model namespace.WeatherVM。然后我就可以很容易地访问所有可用的属性,比如
@Model.TemperatureF
。Intellisense将弹出并让我知道可访问的内容

作为回应,我也想做同样的事情。在我的虚拟机中,如果我有40个属性,我需要一个intellisense或一些可以显示所有可用属性的东西

假设我有这样的东西:

function renderForecastsTable(props) {
    return (
        <table className='table'>
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Temp. (C)</th>
                    <th>Temp. (F)</th>
                    <th>Summary</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {props.forecasts.map(forecast =>
                    <tr key={forecast.dateFormatted}>
                        <td>{forecast.dateFormatted}</td>
                        <td>{forecast.temperatureC}</td>
                        <td>{forecast.temperatureF}</td>
                        <td>{forecast.summary}</td>
                    </tr>
                )}
            </tbody>
        </table>
    );
}
然后尝试让intellisense工作
FetchData.js

import PropTypes from 'prop-types';
export const WeatherForecast = PropTypes.shape({
    TemperatureC: React.PropTypes.string,
    TemperatureF: React.PropTypes.string,
    Summary: React.PropTypes.string,
    TestProp: React.PropTypes.string
});
import * as Model from '../models/weatherForecast';
class FetchData extends Component {
    componentWillMount() {
        this.props.weatherForecast.TestProp // <---- No intellisense or no suggestion was provided for the existence of 'TestProp'. I had to manually write this in.
    }
}
FetchData.prototype = { weatherForecast: Model.WeatherForecast };
import*作为来自“../models/weatherForecast”的模型;
类FetchData扩展组件{
组件willmount(){

this.props.weatherForecast.TestProp/如果使用Visual Studio代码,则可以使用扩展名


这将为您的PropTypes组件提供intellisense建议。

我明白了,这是一个开始。感谢您的建议。我一直在尝试将其用于VS2017,但如果找不到任何解决方案,我将使用VSCode。