Comments (19)
Hi,
Really like the mixins. Do you fancy forking this project or I'm happy to contribute to yours?
from react-bootstrap.
I'm not really clear on the distinction --- I'm happy enough to push code to this repo. Do you think you'll have time to work on this?
from react-bootstrap.
I'm keen to but not sure how much time I will be able to commit. Depends if my current employer adopts React or not.
from react-bootstrap.
Here's a dump of the components I have (messily) implemented at the moment: https://gist.github.com/syllog1sm/8401949
I'm not very experienced with javascript, so I'm not sure how to structure a library. No idea about testing either. I can sort that out once the code's worth showing to people, but I figured I may as well show the current work, rather than sitting on it. If you want to put some of it up in a useable state, great :).
A short write up is on my blog about the tabbed area wrapper, and forms: http://clozeit.wordpress.com/
from react-bootstrap.
Great, thanks!
I've added the BootstrapMixin (slightly modified) and got some tests working.
from react-bootstrap.
Awesome!
I think there's probably enough implemented now that we might switch to an "API-first" design policy, and nail down a document specifying how we want the components to behave.
I haven't worked on a library like this, but I think that API, documentation and testing are the 3 big things. I'm pretty confident the implementation will come together pretty quickly.
Unfortunately I don't have much time to work on this for the next two weeks. So it goes...
from react-bootstrap.
I agree API docs first would be great.
I'm doing TDD at the moment - React components are great for that I think. I've added the size and style mixins. Think I'll setup TravisCI next then refactor ButtonDropdown to take children for the options.
from react-bootstrap.
Sounds great.
I've gone back and forth a bit on child passing. I see three options:
- Pass children as children, i.e.
<Parent>...</Parent>
- Pass children in as a prop, so you write
<Parent children={...}</Parent>
- Pass an array of props objects, and optionally a child class, so you write
<Parent childModels={...} childClass={ChildClass}/>
- is the least convenient to the client in the default case, but leaves them the most flexibility, and makes it possible to modify the child properties. 1 and 2 seem equivalent to me, but there might be something I'm missing. If they are equivalent, then I'd favour 1 between the two.
from react-bootstrap.
Think your code's been stripped. Can you send again with backticks surrounding the code? thanks
from react-bootstrap.
Oops. Done.
from react-bootstrap.
I'd go for supporting both 1 and 3.
from react-bootstrap.
I realised that we can implement 1 whilst still being able to 'modify' the necessary child properties by recreating the child components and passing the props of the real children to them:
https://github.com/stevoland/react-bootstrap/blob/master/src/TabbedArea.jsx#L26
I suppose its inefficient but I think it creates the best API - how I would expect it to work. What do you think?
handleState: function (newIndex) {
this.state({
index: newIndex
});
}
...
<TabbedArea activeIndex={this.state.index} onSelect={this.handleSelect}>
<TabPane tab="Tab 1">Content</Tab>
<TabPane tab="Tab 2">Content 2</Tab>
</TabbedArea>
from react-bootstrap.
Definitely sympathise with the design, but I'm worried that it'll be brittle. Pete Hunt called my attention to this:
https://github.com/facebook/react/blob/master/src/utils/cloneWithProps.js
Implementation:
https://github.com/facebook/react/blob/master/src/core/ReactPropTransferer.js
So, first up, we should use their implementation instead of your mixin. But, they seemed to indicate this was Bad Form. We should consult them on IRC.
from react-bootstrap.
Great work btw. I hadnt checked the project in a few days, it's coming along really nicely!
from react-bootstrap.
Ah, you're one step ahead as usual. Yeah cloneWithProps
is what I was looking for + yeah it does seem a bit hacky but if it's going to remain supported I'd definitely like it as one option at least.
from react-bootstrap.
Fair enough -- gets my +1.
I think if we're going to take the idea of "just deliver the best API" seriously, then this solution is the way to go. Worst comes to worst, if React does change underneath us, we'll just change our internals.
from react-bootstrap.
What do you think about an option for components like TabbedArea to manage their own state or is this too much temptation to use them unwisely?
from react-bootstrap.
Hi,
I'm adding a LICENCE file. What's your real name to put in the copyright bit?
from react-bootstrap.
Heya,
Matthew Honnibal.
On Fri, Feb 7, 2014 at 8:54 PM, Stephen J. Collings <
[email protected]> wrote:
Hi,
I'm adding a LICENCE file. What's your real name to put in the copyright
bit?Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-34422357
.
from react-bootstrap.
Related Issues (20)
- null is not an object (evaluating 'ye.scrollHeight') HOT 1
- Feature Select component with search HOT 1
- Bug - Page Not Found for Tabs Doc Site HOT 3
- Dropdown should overlay the parent container HOT 1
- Alignment of button text in grid changes if href tag is set HOT 1
- Feature Request: Custom Anchor element for PageItem
- Button is not responsive inside the MODAL HOT 3
- defaultActiveKey and alwaysOpen not working properly at the same time HOT 1
- Error using components HOT 1
- NextJS <Link> giving error with react-bootstrap <Navbar.Link> HOT 1
- Docs - Components props tables are missing
- Tabs Component doesn't pass id attribute to underlying element HOT 1
- aria-label for DropdownButton HOT 2
- React Bootstrap doesn't let me set background color HOT 1
- Bug: OverlayTrigger doesn't hide after modal close. HOT 5
- Rendering children (Accordion) HOT 1
- Modal component stop working when closed HOT 6
- Keyboard input Tab + Shift escapes Modal's focus HOT 3
- ESC and Up/Down in Dropdown doesn't work when using the native Bootstrap HOT 2
- Suggest adding 'use clientโ for all the react-bootstrap component HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-bootstrap.