1

To be more specific I have a react application that will not be able to be online that will have documentation available on it.

The documentation unfortunately is either only available through their websites or for download in html format instead of pdf.

https://docs.zeek.org/en/master/

other documentation is multiple html files.

I'm not sure iframe method would work in this scenario but am struggling to find solutions to my issue.

if not possible would it be possible to simply open up the application in a new tab upon clicking a button in the react app.

1

1 Answer 1

0

You can get multiples solutions in thats link

Example:

Add html loader to your project:

npm i -D html-loader

Add the following rule to your webpack.config file:

{
  test: /\.(html)$/,
  use: {
    loader: 'html-loader',
    options: {
      attrs: [':data-src']
    }
  }
}

Import your html file:

import React, { Component } from 'react';
import Page from './test.html';
var htmlDoc = {__html: Page};

export default class Doc extends Component {
  constructor(props){
    super(props);
  }

  render(){
     return (<div dangerouslySetInnerHTML={htmlDoc} />)
}}

Link

React: how to load and render external html file?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.