Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bot] Apply Grit pattern: react_to_hooks #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grit-app[bot]
Copy link

@grit-app grit-app bot commented Aug 14, 2023

⚠️ This migration is out of date with the main branch. Update with Grit ⚠️

⚠️ This pull request was auto-generated with Grit. ⚠️

This pull request was created through the Pattern Studio, with these settings:

  • Target branch: master
  • Source files: **/*
  • Preset pattern: react_to_hooks – This pattern converts React class components to functional components, with hooks.
Pattern body
engine marzano(0.1)
language js

// Most of the logic for this pattern is in react_hooks.grit
// https://github.com/getgrit/js/blob/main/.grit/patterns/react_hooks.grit

pattern regular_first_step() {
  $use_ref_from = .,
  $handler_callback_suffix = "Handler",
  first_step($use_ref_from, $handler_callback_suffix)
}

sequential {
    file(body = program(statements = some bubble($program) regular_first_step())),
    // Run it 3 times to converge
    file(body = second_step(handler_callback_suffix = "Handler")),
    file(body = second_step(handler_callback_suffix = "Handler")),
    file(body = second_step(handler_callback_suffix = "Handler")),
    file($body) where {
      $body <: program($statements),
      $statements <: bubble($body, $program) and {
        maybe adjust_imports(),
        add_more_imports(),
      }
    }
}

Please feel free to provide feedback on this pull request. Any comments will be incorporated into future migrations.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 59 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants