Last active
July 27, 2016 13:34
-
-
Save frontdevops/882a99790dc85439a39241a9636865f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Указать тип | |
const style :ComponentButton = require<ComponentButton>('button.css'); | |
// Если указали тип, то и генерик уже не нужен | |
const style :ComponentButton = require('button.css'); | |
// Применить typecast | |
const style = <ComponentButton> require<ComponentButton>('button.css'); | |
// Ну тогда генерик и ненужен | |
const style = <ComponentButton> require('button.css'); | |
// Другой вариант type assertions (для TSX) | |
const style = require<ComponentButton>('button.css') as ComponentButton; | |
// Опять же без генерика ибо и так будут подсказки | |
const style = require('module.css') as ComponentButton; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment