Drupal, React.js

Loosely Coupled: Pass data to React app via drupalSettings

There may be a need to pass a variable, checkbox settings, or some global settings from drupal to react. This can be achieved by passing data from drupal into an API and consuming the same API in react. But why call an extra API when we can achieve it without it? We will be using #attached/drupalSettings to accomplish this. Step 1:...

by Deepali Agarwal
Tag: Partially Decoupled
29-Dec-2022

Drupal, React.js

Loosely Coupled: Integrate React JS into Drupal sites

React is a JavaScript library that makes it painless to create interactive UIs. Unfortunately, embedding React into a Drupal site is not straightforward. In this article, I will show you relatively simple methods of how to do so. React can be integrated with Drupal in 2 ways: Fully decoupled Partially Decoupled (Loosely...

by Deepali Agarwal
Tag: Partially Decoupled
27-Dec-2022