jd-opensource / jd-opensource/taro-ui

linaria css in js 在taroui不可用

Open
#1,017 13 comments 1 reaction 0 assignees View on GitHub
enhancement help wanted
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

### Taro UI 版本信息

3.0.0-alpha.1

### 问题描述

linaria css in js 在taroui编译时报错

### 复现步骤

1. 配置linaria
2. 编译

### 复现代码

import React from 'react'
import { Text } from '@tarojs/components'
import { AtTag } from 'taro-ui'
import { styled } from 'linaria/react'

//const StyledAtTag = styled(AtTag)<{ color: string }>` // not work

const StyledAtTag = styled(Text )<{ color: string }>` //work

color: ${props => props.color}
`

class TextTag extends React.Component {
render () {
return (

{this.props.children}

)
}
}

export default TextTag

### 报错信息

Module build failed (from ./node_modules/_linaria@1.4.0-beta.6@linaria/loader.js):
NonErrorEmittedError: (Emitted value instead of an instance of Error) ReferenceError: D:\DEV\pcng-client-taro\src\component\Tex
tTag.tsx: clearTimeout is not defined

### 系统信息

3.x

### 补充信息

linaria css in js用于tarojs/components不会报错,用于taroui不行

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.