Other things to do guide

Hey there!

I am totally dummy on this and new in Frontity and react world.

I was completing the step by step guide you have https://tutorial.frontity.org/ (super completed and useful by the way).

And in the ‘Other things to do’ section, I am facing the first challenges.

This is the code I have

import React from "react"
import { connect, styled } from "frontity"

const Destination = ({ state }) => {
    const data = state.source.get(state.router.link)

    return (
        <>
            {
                console.log('Hola')
            }
            {
                const regions = state.source.regions
                for (var x in regions) {
                    var loopData = ''
                    loopData += <h5>The region is {regions[x].name}</h5>
                }
                return( {loopData} )
            }


            <Items>
                {data.items.map((item) => {

And what I would like to do is to iterate over the object regions. Since this is not an array as data.items, I was having an error when trying to iterate using the map. So, researching about how to iterate over an Object like regions, I found that way.

The problem I have is that it seems that within the brackets {} only one JS sentence is admited?

Can you help me to solve this using the best practice?

Thanks in advance!

Hi @adpabloslopez ,

Welcome to the Community!

There are some structures in your code that are not allowed with React.
I recommend you to check first our Javascript and React guides, before going any further

That is correct