glyphic-co/textblock

Import Textblock for React

Open

#37 aberto em 6 de mar. de 2019

Ver no GitHub
 (14 comments) (0 reactions) (0 assignees)JavaScript (18 forks)batch import
help wanted

Métricas do repositório

Stars
 (544 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 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
      <div className="App">
        <h3>This title scales perfectly based on Textblock</h3>
      </div>
    );
  }
}

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.

Guia do colaborador