glyphic-co / glyphic-co/textblock

Import Textblock for React

Open
#37 14 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
JavaScript
Stars
552
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Hello!
First of all, this framework seems pretty cool. Thank you for that!

But I have some problem using it in a React app.

**Expected behaviour in App.js:**

```
import React, { Component } from "react";
import "./App.scss";
import Textblock from "textblock";

class App extends Component {
componentDidMount() {
Textblock([
{
target: "h3",
minWidth: 400,
maxWidth: 800,
minWidthFontSize: 18,
maxWidthFontSize: 24,
minWidthLineHeight: 1.33,
maxWidthLineHeight: 1.2,
units: "px"
}
]);
}

render() {
return


This title scales perfectly based on Textblock



);
}
}

export default App;
```

I guess this is the ES6 way to do it. This is mentioned here: https://github.com/glyphic-co/textblock/issues/7#issuecomment-364515428
**Current behavior**
As it seems now, I have to do this in e.g. index.html the old fashioned way.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.