ZupIT/beagle-web-core

React: remove StyledComponents

Tiagoperes opened this issue · 1 comments

We should remove the dependency for StyledComponents in the default Beagle Componentes for React.

  • This dependency causes problems for users already using StyledComponents in their projects;
  • The random classes created are untestable (hard to read and random names);
  • We should not impose the usage of one more lib if it's not absolutely necessary.

When replacing the lib, consider reusing the css for beagle-angular. Using the same class names for the components will provide much easier to write tests.

When tried changing styled components files to their style files counterparts I faced an issue, typescript does not understand .css or .less files as modules meaning we cannot import them and use the classes definitions in the .tsx files.
To workaround this problem the only solution I see is adding webpack to the project but as I discussed with Tiago I learned we cannot do that due to the fact that this project is a library.
I tried looking for ways of doing so without the need for the webpack and its loaders but with no success so far.