Is it possible to add custom key value pairs to frontity.settings.js?

Let’s say that Add the following to my frontity.settings.js file:

state: {

    frontity: {

      url: "https://test.frontity.io",

      title: "Aslan French",

      description: "Design + Code",

      boingo: "bingo"

    }

Would it be possible to then have a component display the value of the boingo: bingo key value pair as such:

<p>{state.frontity.boingo}</p>

I tried doing this but it didn’t work and I was really clear why.

I’m new to learning React and I’m a little rusty on things because I spent the last month doing non frontend work so maybe I’m just forgetting something really simply about passing new pieces of state down to components but I’m not clear what I’m missing.

EDIT:

Okay I got it working. I needed to add export default connect(ComponentName); instead of just export default Hero;

Reading the docs I see that Connect is Frontity’s state manager. I haven’t yet learned much about third party state management in React, still just working with totally vanilla React projects, so I’m not clear on what state managers are for (other than being vaguely familiar with the concept of Redux and Mobx etc exist) but I get the basic gist of why this wasn’t working.

No never mind! I figured it out. I’ll keep my forum post up though as a form of documentation in case anyone else has a similar question.

Thanks

6 Likes

Great, glad you figured it out. Let us know if you have further issues @thedonquixotic :slightly_smiling_face: !

1 Like