MCPcopy
hub / github.com/MicheleBertoli/react-fix-it

github.com/MicheleBertoli/react-fix-it @v0.3.3 sqlite

repository ↗ · DeepWiki ↗ · release v0.3.3 ↗
19 symbols 26 edges 6 files 0 documented · 0%
README

React Fix It Build Status

Automagically generate tests from errors.

:warning: This package uses react-component-errors to wrap the lifecycle methods into a try...catch block, which affects the performance of your components. Therefore it should not be used in production.

How to use it

  • Enhance your components with fixIt
  • Write some bugs (or wait for your components to fail)
  • Open the console and copy the test snippet
  • Paste the code to reproduce the error
  • Fix the bugs and celebrate

Demo

https://michelebertoli.github.io/react-fix-it/

Preview

Installation

You can either install it with npm or yarn.

npm install --save-dev react-fix-it

or

yarn add --dev react-fix-it

Example

import React, { Component } from 'react'
import fixIt, { options } from 'react-fix-it'

// defaults to console.log
options.log = (test) => {
  console.warn(test)
  doWatheverYouWant(test)
}

class MyComponent extends Component {
  render() {
    return 

Hello ⚛


  }
}

export default fixIt(MyComponent)

:bulb: They easiest way to patch automatically all the components in development mode is by using babel-plugin-react-fix-it with the following configuration:

{
  "env": {
    "development": {
      "plugins": ["react-fix-it"]
    }
  }
}

Test

npm test

or

yarn test

Core symbols most depended-on inside this repo

fixIt
called by 3
src/fix-it.js
componentWillReceiveProps
called by 0
demo/entry.js
render
called by 0
demo/entry.js
constructor
called by 0
demo/entry.js
render
called by 0
demo/entry.js
constructor
called by 0
demo/entry.js
handleClick
called by 0
demo/entry.js
render
called by 0
demo/entry.js

Shape

Method 10
Class 8
Function 1

Languages

TypeScript100%

Modules by API surface

demo/entry.js13 symbols
test/fix-it.spec.js5 symbols
src/fix-it.js1 symbols

Dependencies from manifests, versioned

babel-cli6.18.0 · 1×
babel-core6.21.0 · 1×
babel-jest17.0.2 · 1×
babel-loader6.2.10 · 1×
babel-preset-es20156.18.0 · 1×
babel-preset-react6.16.0 · 1×
enzyme2.6.0 · 1×
eslint3.12.2 · 1×
eslint-config-airbnb13.0.0 · 1×
eslint-plugin-import2.2.0 · 1×
eslint-plugin-jsx-a11y2.2.3 · 1×
eslint-plugin-react6.8.0 · 1×

For agents

$ claude mcp add react-fix-it \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact