unsetReact

unsetReact(void)

A common usage of GroceryCRUD is to be used in an already existing admin template or an already existing project. As React is a bit heavy library by its own, it is important to be loaded only once. For example, if your project already have React we don't have to load it again. In that case we are using the unsetReact method. The syntax is simple as it doesn't take any parameters.

For example:

$crud->unsetReact()

The most common usages of this method is:

  1. When you've already have loaded React to your template and you don't want to load it twice with Grocery CRUD
  2. You would like to experiment with newer versions of React
  3. You are using React library through CDN

You can see a full example below:

$crud->setTable('customers');
$crud->setSubject('Customer', 'Customers');
$crud->columns(['customerName','phone','addressLine1','creditLimit']);

$crud->unsetReact();

$output = $crud->render();