Skip to content
Snippets Groups Projects

Resolve #3441930 "Create a demo"

Open utkarsh_33 requested to merge issue/jsx-3441930:3441930-create-a-demo into 1.0.x
3 unresolved threads

Closes #3441930

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 <?php
2
3 use Drupal\Core\Extension\Extension;
4
5 /**
6 * Implements hook_system_info_alter().
7 */
8 function demo_jsx_info_alter(array &$info, Extension $file, $type): void {
9 $info['engine'] = 'jsx';
  • utkarsh_33 added 1 commit
  • 1 <?php
    2
    3 /**
    4 * Implements hook_theme_suggestions_HOOK_alter() to conditionally suggest JSX templates.
    5 */
    6 function demo_jsx_theme_suggestions_block_alter(array &$suggestions, array $variables) {
    7 $current_path = \Drupal::service('path.current')->getPath();
    8 $temp=[] ;
    9
    10 foreach ($suggestions as $suggestion) {
    11 if($suggestion == 'block__search_form_block'){
  • 1 <?php
    2
    3 namespace Drupal\demo_jsx\Controller;
    4
    5 use Drupal\Core\Controller\ControllerBase;
    6
    7 class ReactComponentController extends ControllerBase {
    8
    9 public function renderReactUI() {
    10 // Attach the necessary library for React component.
    11 $build['#attached']['library'][] = 'demo_jsx/demo_jsx.react';
    • This is a change that was trying to load the files from jsx modules just for testing and maybe rendering the contents of the file in some block(something similar to demo_jsx.module's if condition).

    • Please register or sign in to reply
    Please register or sign in to reply
    Loading