DEV Community

Discussion on: Would You Use Vanilla JavaScript (No Framework) On a Project?

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

I'll take a try to the podcast then :)

By the other hand, the rule of thumb for something being a FW or a lib is IoC (inversion of control, a concept where general application flow is inverted), which is achieved by using a service locator pattern, dependency injection pattern, contextualized lookup or a couple of techniques more, depending on the tool.

In Angular or Vue, is Angular or Vue who's calling your code to interpret and do whatever they need to do.

In React you're the one telling React what to render ReactDOM.render(<App />, document.getElementById('app')); plus in React's homepage hero it states clearly "A JavaScript library for building user interfaces"

There are some wrappers to apply IoC to React Apps (check this one) that serves more the purpose on adding dependency injection capabilities to avoid issues
i.e.

  • With Redux having to import it everywhere which is a nonsense.
  • Passing props through components that don't use them (breaking SOLID)*
  • Other issues that can be either a bad app design decision or anything else.

I never needed it though but knowing that it exists is nice just in case 😂 just to clarify, adding a third party lib to handle IoC and DI inside a React App doesn't make it a framework, still it's not part of the core API.

Best regards, and please, ping me if you upload things to youtube 😁