使用样式化组件反应SSR

时间:2020-10-26 02:15:02

标签: reactjs styled-components server-side-rendering

在使用带有样式组件的React SSR时遇到问题。我有一个SSR代码,该代码需要一个与Webpack和Babel捆绑在一起的组件并将其呈现为字符串,但是样式组件的sheet.getStyleTags()始终返回空字符串。有谁知道如何解决

ggplot(data = df, aes(x="", y=proportion, fill=HPV)) +
  geom_col(color = "black") + 
  coord_polar("y", start=0) +
  geom_text(aes(x=1.6, label=paste0(round(proportion*100), "%")),
            position = position_stack(vjust=0.5)) +
  theme(panel.background = element_blank(),
        axis.line = element_blank(),
        axis.text = element_blank(),
        axis.ticks = element_blank(),
        axis.title = element_blank(),
        plot.title = element_text(hjust = 0.5, size = 18)) +
  ggtitle("Subtypes of HPV in GDC TCGA cervical cancer (CESC)") + 
  scale_fill_manual(values = c("#F46698","#F36DDB","#DD6DF3","#AC6DF3","#7355FC","#5562FC","#5562FC","#55B5FC","#55C7FC","#55E8FC","#56EDEB","#93F9EF","#61F9BF","#5BEC75","#58D64B","#91D64B","#B4D64B","#D6D64B","#FFDB57"))

0 个答案:

没有答案