React Developer Tools

https://www.npmjs.com/package/react-devtools

# Yarn 
yarn global add react-devtools
 
# NPM 
npm install -g react-devtools

Cách kết nối mới nhất 12/14/2024 https://github.com/zalmoxisus/redux-devtools-extension#usage

src\index.tsx

import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { legacy_createStore as createStore, applyMiddleware, compose  } from 'redux';
import myReducer from './reducers';
import { Provider } from 'react-redux';
declare global {
  interface Window {
    __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: typeof compose;
  }
}
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(myReducer, composeEnhancers());
const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <React.StrictMode>
    <Provider store={store}><App /></Provider>
  </React.StrictMode>
);
reportWebVitals();

Last updated

Was this helpful?