added a volunteering functionality#89
Conversation
| </div> | ||
| </div> | ||
| </div> | ||
| // <div className="col-12 Bookcard"> |
There was a problem hiding this comment.
Add a TODO if you will use it in the future
| this.getCountryCode( countries[countryCode]); | ||
| } | ||
|
|
||
| getCountryCode(country) { |
There was a problem hiding this comment.
You can wrap your method inside the componentDidMount function to ensure that the component is done mounting to the ReactDOM
|
|
||
|
|
||
|
|
||
| componentWillMount() { |
There was a problem hiding this comment.
There is a controversy regarding the call of fetch method in the componentWillMount.
One thing remains, your call is an asynchronous call that will only return when the render happens or later.
Your rendering won't be able to be paused waiting for the data to be displayed.
With this method you have better chances for your component to be empty first up until your data is rendered.
Since you have chosen this path, find a suitable way to grey out the field that are waiting to display data.
Else, you can use the componentDidMount
| .then((response) => response.json()) | ||
| .then( | ||
| (data) => { | ||
| console.log(data); |
| }) | ||
| }, | ||
| (error) => { | ||
| console.log(error); |
There was a problem hiding this comment.
Remove the console if you have more before pushing them
| @@ -0,0 +1,9 @@ | |||
| .btn-volunteer-title{ | |||
| border-radius: 100px !important; | |||
There was a problem hiding this comment.
The usage of !important has been preached to your peers.
Do not make use of it unless it is your last option
| .then((response) => response.json()) | ||
| .then( | ||
| (data) => { | ||
| console.log(data); |
| console.log(data); | ||
| this.projects = data.map((item) => { | ||
|
|
||
| return ( |
There was a problem hiding this comment.
What are you returning?
added a volunteering functionality