Импорт псевдонима машинописного текста с автозаполнением - PullRequest
0 голосов
/ 07 августа 2020

У меня есть компонент Alert React ниже:

  import React from 'react';
  
  interface Props {
    message: string;
  };

  const Alert = (props: Props) => {
    return (
      <div>{props.message}</div>
    );
  };

  export default Alert;

Я использую alias import вместо relative import :

  // alias import
  import Alert from 'components/Alert';

  // relative import
  // import Alert from '../../components/Alert';  

  const App = () => {
    return (
      <div>
        <Alert message="I want to know the interface of Alert" />
      </div>
    );
  };

  export default App;

Если я наберу "

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...