storybookjs/react-inspector hiện có 854 sao trên GitHub, viết chủ yếu bằng TypeScript. 🔍 Power of Browser DevTools inspectors right inside your React app
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Power of Browser DevTools inspectors right inside your React app. Check out the storybook for a demo.
Install
NPM:
npm install react-inspector
Recommended versions:
version 3.0.2: If you are using React 16.8.4 or later.
version 2.3.1: If you are using an earlier version of React.
Getting started
<Inspector />
A shorthand for the inspectors.
<Inspector/> is equivalent to <ObjectInspector> or <DOMInspector> if inspecting a DOM Node.
<Inspector table/> is equivalent to <TableInspector>.
<ObjectInspector />
Like console.log. Consider this as a glorified version of <pre>JSON.stringify(data, null, 2)</pre>.
How it works
Tree state is saved at root. If you click to expand some elements in the hierarchy, the state will be preserved after the element is unmounted.
API
The component accepts the following props:
data: PropTypes.any: the Javascript object you would like to inspect
name: PropTypes.string: specify the optional name of the root node, default to undefined
expandLevel: PropTypes.number: an integer specifying to which level the tree should be initially expanded
expandPaths: PropTypes.oneOfType([PropTypes.string, PropTypes.array]): an array containing all the paths that should be expanded when the component is initialized, or a string of just one path
The path string is similar to JSONPath.
It is a dot separated string like $.foo.bar. $.foo.bar expands the path $.foo.bar where $ refers to the root node. Note that it only expands that single node (but not all its parents and the root node). Instead, you should use expandPaths={['$', '$.foo', '$.foo.bar']} to expand all the way to the $.foo.bar node.
You can refer to array index paths using ['$', '$.1']
You can use wildcard to expand all paths on a specific level
For example, to expand all first level and second level nodes, use ['$', '$.*'] (equivalent to expandLevel={2})
the results are merged with expandLevel
showNonenumerable: PropTypes.bool: show non-enumerable properties
sortObjectKeys: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]): Sort object keys with optional compare function
When sortObjectKeys={true} is provided, keys of objects are sorted in alphabetical order except for arrays.
nodeRenderer: PropTypes.func: Use a custom nodeRenderer to render the object properties (optional)
Instead of using the default nodeRenderer, you can provide a
custom function for rendering object properties. The default
nodeRender looks like this:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/storybookjs/react-inspector là nguồn chính thức.
storybookjs/react-inspector có bao nhiêu sao?
storybookjs/react-inspector có 854 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/storybookjs/react-inspector. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
storybookjs/react-inspector có phải mã nguồn mở không?
Có — storybookjs/react-inspector phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/storybookjs/react-inspector.
storybookjs/react-inspector có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho storybookjs/react-inspector. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
storybookjs/react-inspector có trang demo không?
Dự án có trang chủ ở https://5d8cb665bc622e0020296079-dippbxxgcq.chromatic.com/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
storybookjs/react-inspector còn đang phát triển không?
Commit gần nhất trên storybookjs/react-inspector là 7 tháng trước (theo timestamp GitHub). Repo có 103 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về react-inspector?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về react-inspector.