question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cleanup react components

See original GitHub issue

Since the react-figma-plugin-ds dependency is broken, I recently “imported” the components that are used in this plugin. However they need to be cleaned up, including the css.

This includes (but is not limited to):

  • Button
  • Checkbox
  • Select
  • Title
  • Input
  • Label
  • Text

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lukasoppermanncommented, Nov 26, 2021

Yeah, no worries, makes sense. I removed the two labels, as I realised that it has more complexity to it than I thought. Working on open source is a great idea though. Just find another problem to solve here or in another project. 👍

Cheers & thanks for offering help.

1reaction
lukasoppermanncommented, Nov 26, 2021

Sure, so the components are mainly copied from the react-figma-plugin-ds package.

This means there is probably css in there that is never used in the plugin. -> This css should be removed.

Also there may be states in the components that are never used. Those states should be removed as well. This often leads to being able to remove more code from the components.

The goal of this is that the components react code & css (which is within the .tsx file) gets less complex.

Hope that helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding React's useEffect cleanup function
According to React's official documentation, “React performs the cleanup when the component unmounts. However… effects run for every render ...
Read more >
React useEffect cleanup: How and when to use it
This is very useful because we can use it to remove unnecessary behavior or prevent memory leaking issues.
Read more >
How to use react clean-up function with example - Dev Genius
This clean-up function is to be used to clean up the effect of an old side effect. This function is obligatory called before...
Read more >
Why you should always Cleanup Side Effects in React ...
The cleanup function in useEffect is a handy function that gives us as much power as class components. There's the componentWillUnmount ...
Read more >
React useEffect cleanup
Cleaning up useEffect permalink ... The hook comes with a cleanup function, which you might not always need, but it can come in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found