Skip to content

Commit 05e6658

Browse files
committed
Fixed bug causing ConstraintGuide to be classified as ConstrainedView
1 parent 58aeec5 commit 05e6658

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
react-constraint-layout is a Javascript library that provides a constraint based solution to position HTML elements relative to each other and to the parent **with zero CSS**.
44

55
![](https://img.shields.io/badge/react-v16.2.0+-blue)
6-
![](https://img.shields.io/badge/minified%20size-39.7%20kB-blue)
6+
![](https://img.shields.io/badge/minified%20size-32.7%20kB-blue)
77
[![](https://img.shields.io/badge/github-star-lightgrey)](https://github.com/kwameopareasiedu/react-constraint-layout)
88
[![](https://img.shields.io/badge/patreon-support-orange)](https://www.patreon.com/kwameopareasiedu)
99

dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "react-constraint-layout",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "React implementation of Android's ConstraintLayout",
55
"author": "Kwame Opare Asiedu",
66
"license": "MIT",
77
"scripts": {
88
"storybook": "start-storybook -p 6006",
99
"build-storybook": "build-storybook -c .storybook -o docs",
10+
"test-build": "rollup --watch -c rollup.config.js --environment INCLUDE_DEPS,BUILD:production",
1011
"build": "rollup -c rollup.config.js --environment INCLUDE_DEPS,BUILD:production",
1112
"test": "echo \\\"Error: no tests specified\\\" && exit 1"
1213
},
@@ -56,5 +57,6 @@
5657
},
5758
"peerDependencies": {
5859
"react": "^16.12.0"
59-
}
60+
},
61+
"dependencies": {}
6062
}

src/constraint-layout.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export const ConstraintLayout = ({ _ref, id, className, width, height, children
1515
if (!isDefined(height)) throw "<ConstraintLayout /> height is required";
1616

1717
const childrenArray = Children.toArray(children);
18-
const validChildPrototypes = [ConstrainedView.prototype, ConstraintLayout.prototype];
19-
const views = childrenArray.filter(c => c.type && validChildPrototypes.includes(c.type.prototype));
20-
const guides = childrenArray.filter(c => c.type && ConstraintGuide.prototype === c.type.prototype);
18+
const validChildFunctions = [ConstrainedView, ConstraintLayout];
19+
const views = childrenArray.filter(c => c.type && validChildFunctions.includes(c.type));
20+
const guides = childrenArray.filter(c => c.type && c.type === ConstraintGuide);
2121
const refs = useRef(Array(views.length).fill(null));
2222
const solverRef = useRef(() => {});
2323
const rootRef = useRef();

0 commit comments

Comments
 (0)