Can you use es6 import alias syntax for React Components?

前端 未结 6 1911
抹茶落季
抹茶落季 2021-01-30 12:35

I\'m trying to do something like the following, however it returns null:

import { Button as styledButton } from \'component-library\'

then atte

6条回答
  •  梦毁少年i
    2021-01-30 13:21

    note that when you capitalized StyledLibrary and it worked

    whereas, in the original question, you did not capitalize styledButton and it did not work

    both of these are the expected results with React

    so you didn't discover a workaround, you simply discovered the (documented) React way of doing things

提交回复
热议问题