-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade #3
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
Upgrade #3
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| .DS_Store | ||
| node_modules | ||
| dist | ||
| dist/* | ||
| !dist/react-grid-layout.min* | ||
| !dist/*.html | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import React from 'react'; | ||
| import RGL, { WidthProvider } from 'react-grid-layout'; | ||
|
|
||
| const ReactGridLayout = WidthProvider(RGL); | ||
|
|
||
|
|
||
| export const IsBounded = ({ onDragStop }) => { | ||
|
|
||
| const layout = [ | ||
| { i: '0', x: 0, y: 0, w: 1, h: 1 }, | ||
| { i: '1', x: 1, y: 0, w: 1, h: 1 }, | ||
| ] | ||
|
|
||
| return ( | ||
| <ReactGridLayout | ||
| layout={layout} | ||
| isBounded={true} | ||
| onDragStop={onDragStop} | ||
| > | ||
| { | ||
| layout.map(ele => <div key={ele.i}>{ele.i}</div>) | ||
| } | ||
| </ReactGridLayout> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import React from "react"; | ||
| import { createRoot } from "react-dom/client"; | ||
| import ReactDOM from "react-dom"; | ||
| import "style-loader!css-loader!../css/styles.css"; | ||
| import "style-loader!css-loader!../examples/util/example-styles.css"; | ||
| typeof window !== "undefined" && (window.React = React); // for devtools | ||
|
|
@@ -44,8 +44,10 @@ export default function makeLayout(Layout) { | |
| function run() { | ||
| const contentDiv = document.getElementById("content"); | ||
| const gridProps = window.gridProps || {}; | ||
| const root = createRoot(contentDiv); | ||
| root.render(React.createElement(ListeningLayout, gridProps)); | ||
| ReactDOM.render( | ||
| React.createElement(ListeningLayout, gridProps), | ||
| contentDiv | ||
| ); | ||
|
Comment on lines
+47
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update rendering logic to use modern React 18 API. Correspondingly, the rendering logic should use the modern - ReactDOM.render(
- React.createElement(ListeningLayout, gridProps),
- contentDiv
- );
+ const root = createRoot(contentDiv);
+ root.render(React.createElement(ListeningLayout, gridProps));
π€ Prompt for AI Agents |
||
| } | ||
| if (!document.getElementById("content")) { | ||
| document.addEventListener("DOMContentLoaded", run); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Verification agent
β Verification inconclusive
distentry shadows the later negate rules β minified bundles & HTML will now be ignoredAdding the bare
distpattern ignores the directory itself, so Git stops traversing its contents.The subsequent negations (
!dist/react-grid-layout.min*,!dist/*.html) therefore no longer take effect, meaning the artefacts you explicitly wanted to keep tracked will be excluded from commits and npm publishes.Remove the new line or restructure the rules as follows:
Failing to fix this will drop your distributable assets from the repo and packaged tarball.
Please verify
npm packoutput after the change.Restructure
.gitignoreto preserve specificdistartefactsThe bare
distentry prevents Git from descending into that directory, so your negations never take effect. Remove it and ignore everything insidedist/first, then re-include the files you need.β’ File:
.gitignoreβ’ Lines: 3β6
After updating, confirm your changes with
git check-ignore -v dist/react-grid-layout.min.jsor by runningnpm packto ensure the artefacts are included.π€ Prompt for AI Agents