React/Redux - publish component #323
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
|
||||
function ActiveStatusBar () {
|
||||
const ActiveStatusBar = () => {
|
||||
return <span className="progress-bar progress-bar--active">| </span>;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
function InactiveStatusBar () {
|
||||
const InactiveStatusBar = () => {
|
||||
return <span className="progress-bar progress-bar--inactive">| </span>;
|
||||
}
|
||||
|
||||
export default InactiveStatusBar();
|
||||
export default InactiveStatusBar;
|
|
@ -7,7 +7,6 @@ class ProgressBar extends React.Component {
|
|||
![]() It looks as if its seeding the progress visually, is that correct? It looks as if its seeding the progress visually, is that correct?
![]() Instead of adding react elements to state, just store the data. Then in the Instead of adding react elements to state, just store the data.
Then in the `render` function, you can do
`this.state.bars.map((bar, index) => bar.isActive ? <ActiveBar key={index} /> : <InactiveBar key={index} />)`
![]() Yes, I am rendering the Yes, I am rendering the `|`s for the progress bars
![]() What is the What is the `|` doing here?
![]() It looks as if its seeding the progress visually, is that correct? It looks as if its seeding the progress visually, is that correct?
![]() Instead of adding react elements to state, just store the data. Then in the Instead of adding react elements to state, just store the data.
Then in the `render` function, you can do
`this.state.bars.map((bar, index) => bar.isActive ? <ActiveBar key={index} /> : <InactiveBar key={index} />)`
![]() Yes, I am rendering the Yes, I am rendering the `|`s for the progress bars
|
||||
constructor (props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
size : 12,
|
||||
![]() What is the What is the `|` doing here?
![]() It looks as if its seeding the progress visually, is that correct? It looks as if its seeding the progress visually, is that correct?
![]() Instead of adding react elements to state, just store the data. Then in the Instead of adding react elements to state, just store the data.
Then in the `render` function, you can do
`this.state.bars.map((bar, index) => bar.isActive ? <ActiveBar key={index} /> : <InactiveBar key={index} />)`
![]() Yes, I am rendering the Yes, I am rendering the `|`s for the progress bars
|
||||
bars : [],
|
||||
index : 0,
|
||||
incrementer: 1,
|
||||
|
|
|||
![]() What is the What is the `|` doing here?
![]() It looks as if its seeding the progress visually, is that correct? It looks as if its seeding the progress visually, is that correct?
![]() Instead of adding react elements to state, just store the data. Then in the Instead of adding react elements to state, just store the data.
Then in the `render` function, you can do
`this.state.bars.map((bar, index) => bar.isActive ? <ActiveBar key={index} /> : <InactiveBar key={index} />)`
![]() Yes, I am rendering the Yes, I am rendering the `|`s for the progress bars
![]() What is the What is the `|` doing here?
![]() It looks as if its seeding the progress visually, is that correct? It looks as if its seeding the progress visually, is that correct?
![]() Instead of adding react elements to state, just store the data. Then in the Instead of adding react elements to state, just store the data.
Then in the `render` function, you can do
`this.state.bars.map((bar, index) => bar.isActive ? <ActiveBar key={index} /> : <InactiveBar key={index} />)`
![]() Yes, I am rendering the Yes, I am rendering the `|`s for the progress bars
|
What is the
|
doing here?